home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / gcc260utilsdoc.lha / gnu / man / man1 / ksh.1 < prev    next >
Encoding:
Text File  |  1994-07-26  |  113.4 KB  |  2,050 lines

  1.  
  2.  
  3.  ksh(C)                        06 January 1993                         ksh(C)
  4.  
  5.  _N_a_m_e
  6.  
  7.     ksh, rksh - KornShell, a standard/restricted command and programming lan-
  8.     guage
  9.  
  10.  _S_y_n_t_a_x
  11.  
  12.     kksshh [ +-aefhikmnoprstuvx ] [ +-o _oo_pp_tt_ii_oo_nn ] ... [ --cc _ss_tt_rr_ii_nn_gg ] [ _aa_rr_gg ... ]
  13.  
  14.     rrkksshh [ +-aefhikmnoprstuvx ] [ +-o _oo_pp_tt_ii_oo_nn ] ... [ --cc _ss_tt_rr_ii_nn_gg ] [ _aa_rr_gg ... ]
  15.  
  16.  _D_e_s_c_r_i_p_t_i_o_n
  17.  
  18.     kksshh is a command and programming language that executes commands read
  19.     from a terminal or a file.  rrkksshh is a restricted version of the command
  20.     interpreter kksshh; it is used to set up login names and execution environ-
  21.     ments whose capabilities are more controlled than those of the standard
  22.     shell.  See ``Invocation'' below for the meaning of arguments to the
  23.     shell.
  24.  
  25.     _D_e_f_i_n_i_t_i_o_n_s
  26.  
  27.     A _m_e_t_a_c_h_a_r_a_c_t_e_r is one of the following characters:
  28.  
  29.        ;    &    (    )    |    <    >    new-line    space    tab
  30.  
  31.     A _b_l_a_n_k is a space or a tab.
  32.  
  33.     An _i_d_e_n_t_i_f_i_e_r is a sequence of letters, digits, or underscores starting
  34.     with a letter or underscore.  Identifiers are used as names for functions
  35.     and named parameters.
  36.  
  37.     A _w_o_r_d is a sequence of characters separated by one or more non-quoted
  38.     metacharacters.
  39.  
  40.     _C_o_m_m_a_n_d_s
  41.  
  42.     A _c_o_m_m_a_n_d is a sequence of characters in the syntax of the shell lan-
  43.     guage.  The shell reads each command and carries out the desired action
  44.     either directly or by invoking separate utilities.
  45.  
  46.     A _s_p_e_c_i_a_l _c_o_m_m_a_n_d is a command that is carried out by the shell without
  47.     creating a separate process.  Except for documented side effects, most
  48.     special commands can be implemented as separate utilities.
  49.  
  50.     A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of blank-separated words which may be pre-
  51.     ceded by a parameter assignment list.  (See ``Environment'' below).  The
  52.     first word specifies the name of the command to be executed.  Except as
  53.     specified below, the remaining words are passed as arguments to the
  54.     invoked command.  The command name is passed as argument 0 (see eexxeecc(S)).
  55.     The value of a simple-command is its exit status if it terminates nor-
  56.     mally, or (octal) 200+_ss_tt_aa_tt_uu_ss if it terminates abnormally (see ssiiggnnaall(S)
  57.     for a list of status values).
  58.  
  59.     A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by ``|''.  The
  60.     standard output of each command but the last is connected by a ppiippee(S) to
  61.     the standard input of the next command.  Each command is run as a
  62.     separate process; the shell waits for the last command to terminate.  The
  63.     exit status of a pipeline is the exit status of the last command.
  64.  
  65.     A _l_i_s_t is a sequence of one or more pipelines separated by ;; && &&&& or ||||
  66.     and optionally terminated by ;; && or ||&&.  Of these five symbols, &&&& and ||||
  67.     have highest precedence.  The following three symbols, ;; && and ||&& are of
  68.     equal precedence, as are &&&& and ||||.  A semicolon (;) causes sequential
  69.     execution of the preceding pipeline; an ampersand (&) causes asynchronous
  70.     execution of the preceding pipeline (that is, the shell does _n_o_t wait for
  71.     that pipeline to finish).  The symbol ||&& causes asynchronous execution of
  72.     the preceding command or pipeline with a two-way pipe established to the
  73.     parent shell.  The parent shell can write to and read from the standard
  74.     input and standard output of the spawned command using the --pp option of
  75.     the special commands rreeaadd and pprriinntt (described later). The symbol &&&& (||||)
  76.     causes the list following it to be executed only if the preceding pipe-
  77.     line returns a zero (non-zero) value.  An arbitrary number of new-lines
  78.     may appear in a list, instead of a semicolon, to delimit a command.
  79.  
  80.     A command is either a simple-command or one of the following compound-
  81.     commands.  A _c_o_m_p_o_u_n_d-_c_o_m_m_a_n_d is a command that results in the execution
  82.     of one or more simple-commands, depending upon the state of its input.
  83.     Unless otherwise stated, the value returned by a command is that of the
  84.     last simple-command executed in the command.
  85.  
  86.     ffoorr _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr [ iinn _ww_oo_rr_dd ... ] ;;ddoo _ll_ii_ss_tt ;;ddoonnee
  87.          Each time a ffoorr command is executed, _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr is set to the next
  88.          word taken from the iinn _ww_oo_rr_dd list.  If iinn _ww_oo_rr_dd ... is omitted, then
  89.          the ffoorr command executes the ddoo _ll_ii_ss_tt once for each positional param-
  90.          eter that is set (see ``Parameter substitution'' below).  Execution
  91.          ends when there are no more words in the list.
  92.  
  93.     sseelleecctt _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr [ iinn _ww_oo_rr_dd ... ] ;;ddoo _ll_ii_ss_tt ;;ddoonnee
  94.          A sseelleecctt command prints on standard error (file descriptor 2), the
  95.          set of words, each preceded by a number.  If iinn _ww_oo_rr_dd ... is omitted,
  96.          then the positional parameters are used instead (see ``Parameter
  97.          substitution'' below).  The PS3 prompt is printed and a line is read
  98.          from the standard input.  If this line consists of the number of one
  99.          of the listed words, then the value of the parameter _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr is
  100.          set to the word corresponding to this number.  If this line is empty
  101.          the selection list is printed again.  Otherwise the value of the
  102.          parameter _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr is set to null.  The contents of the line read
  103.          from standard input is saved in the parameter RREEPPLLYY. The list is
  104.          executed for each selection until a break or end-of-file is encoun-
  105.          tered.
  106.  
  107.     ccaassee _ww_oo_rr_dd iinn [ [((] _pp_aa_tt_tt_ee_rr_nn [ | _pp_aa_tt_tt_ee_rr_nn ] ... )) _ll_ii_ss_tt ;;;; ] ... eessaacc
  108.          A ccaassee command executes the list associated with the first pattern
  109.          that matches _ww_oo_rr_dd.  The form of the patterns is the same as that
  110.          used for file-name generation (see ``File name generation'' below).
  111.  
  112.     iiff _ll_ii_ss_tt ;;tthheenn _ll_ii_ss_tt [  eelliiff _ll_ii_ss_tt ;;tthheenn _ll_ii_ss_tt ] ... [ ;;eellssee _ll_ii_ss_tt ] ;;ffii
  113.          The list following iiff is executed and, if it returns a zero exit
  114.          status, the list following the first tthheenn is executed.  Otherwise,
  115.          the list following eelliiff is executed and, if its value is zero, the
  116.          list following the next tthheenn is executed.  Failing that, the eellssee
  117.          list is executed.  If no eellssee list or tthheenn list is executed, the iiff
  118.          command returns a zero exit status.
  119.  
  120.     wwhhiillee _ll_ii_ss_tt ;;ddoo _ll_ii_ss_tt ;;ddoonnee
  121.     uunnttiill _ll_ii_ss_tt ;;ddoo _ll_ii_ss_tt ;;ddoonnee
  122.          A wwhhiillee command repeatedly executes the wwhhiillee list and, if the exit
  123.          status of the last command in the list is zero, executes the ddoo
  124.          list; otherwise the loop terminates.  If no commands in the ddoo list
  125.          are executed, then the wwhhiillee command returns a zero exit status;
  126.          uunnttiill may be used in place of wwhhiillee to negate the loop termination
  127.          test.
  128.  
  129.     (( _ll_ii_ss_tt ))
  130.          Execute _ll_ii_ss_tt in a separate environment.  Note, that if two adjacent
  131.          open parentheses are needed for nesting, a space must be inserted to
  132.          avoid arithmetic evaluation as described below.
  133.  
  134.     {{ _ll_ii_ss_tt ;;}}
  135.          _ll_ii_ss_tt is simply executed.  Note that unlike the metacharacters ``(''
  136.          and ``)'', ``{'' and ``}'' are reserved words and must be at the
  137.          beginning of a line or after a ``;'' in order to be recognized.
  138.  
  139.     [[[[ _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn ]]]]
  140.          Evaluates _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn and returns a zero exit status when _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn
  141.          is true.  See ``Conditional expressions'' below, for a description
  142.          of _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn.
  143.  
  144.     ffuunnccttiioonn _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr {{ _ll_ii_ss_tt ;;}}
  145.     _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr (()) {{ _ll_ii_ss_tt ;;}}
  146.          Define a function which is referenced by _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr.  The body of
  147.          the function is the list of commands between ``{'' and ``}''.  (See
  148.          ``Functions'' below.)
  149.  
  150.     ttiimmee _pp_ii_pp_ee_ll_ii_nn_ee
  151.          The _pp_ii_pp_ee_ll_ii_nn_ee is executed and the elapsed time as well as the user
  152.          and system time are printed on standard error.
  153.  
  154.     The following reserved words are only recognized as the first word of a
  155.     command and when not quoted:
  156.  
  157.     iiff         tthheenn       eellssee       eelliiff       ffii         ccaassee
  158.     eessaacc       ffoorr        wwhhiillee      uunnttiill      ddoo         ddoonnee
  159.     {{ }}        ffuunnccttiioonn   sseelleecctt     ttiimmee       [[[[ ]]]]
  160.  
  161.     _C_o_m_m_e_n_t_s
  162.  
  163.     A word beginning with ``#'' causes that word and all the following char-
  164.     acters up to a new-line to be ignored.
  165.  
  166.     _A_l_i_a_s_i_n_g
  167.  
  168.     The first word of each command is replaced by the text of an alias if an
  169.     alias for this word has been defined.  An alias name consists of any num-
  170.     ber of characters excluding metacharacters, quoting characters, file
  171.     expansion characters, command substitution characters, and the equals
  172.     sign (=).  The replacement string can contain any valid shell script
  173.     including the metacharacters listed above.  The first word of each com-
  174.     mand in the replaced text, other than any that are in the process of
  175.     being replaced, will be tested for aliases.  If the last character of the
  176.     alias value is a _b_l_a_n_k then the word following the alias will also be
  177.     checked for alias substitution.  Aliases can be used to redefine special
  178.     built in commands but cannot be used to redefine the reserved words
  179.     listed above.  Aliases can be created, listed, and exported with the
  180.     aalliiaass command and can be removed with the uunnaalliiaass command.  Exported
  181.     aliases remain in effect for scripts invoked by name, but must be reini-
  182.     tialized for separate invocations of the shell (see ``Invocation''
  183.     below).
  184.  
  185.     Aliasing is performed when scripts are read, not while they are executed.
  186.     Therefore, for an alias to take effect the aalliiaass definition command has
  187.     to be executed before the command which references the alias is read.
  188.  
  189.     Aliases are frequently used as an abbreviation for full path names.  An
  190.     option to the aliasing facility allows the value of the alias to be auto-
  191.     matically set to the full pathname of the corresponding command.  These
  192.     aliases are called _t_r_a_c_k_e_d aliases.  The value of a tracked alias is
  193.     defined the first time the corresponding command is looked up and becomes
  194.     undefined each time the PPAATTHH variable is reset.  These aliases remain
  195.     tracked so that the next subsequent reference will redefine the value.
  196.     Several tracked aliases are compiled into the shell.  The --hh option of
  197.     the sseett command makes each referenced command name into a tracked alias.
  198.  
  199.     The following _e_x_p_o_r_t_e_d aliases are compiled into the shell but can be
  200.     unset or redefined:
  201.  
  202.     aauuttoollooaadd='ttyyppeesseett --ffuu'
  203.     ffaallssee='lleett 00'
  204.     ffuunnccttiioonnss='ttyyppeesseett --ff'
  205.     hhaasshh='aalliiaass --tt'
  206.     hhiissttoorryy='ffcc --ll'
  207.     iinntteeggeerr='ttyyppeesseett --ii'
  208.     nnoohhuupp='nnoohhuupp<<'
  209.     rr='ffcc --ee --'
  210.     ttrruuee='::'
  211.     ttyyppee='wwhheennccee --vv'
  212.  
  213.     (The alias of nnoohhuupp with a trailing space allows nnoohhuupp to be used with
  214.     aliases.)
  215.  
  216.     _T_i_l_d_e _s_u_b_s_t_i_t_u_t_i_o_n
  217.  
  218.     After alias substitution is performed, each word is checked to see if it
  219.     begins with an unquoted ``~''.  If it does, then the word up to a ``/''
  220.     is checked to see if it matches a user name in the /_e_t_c/_p_a_s_s_w_d file.  If
  221.     a match is found, the ``~'' and the matched login name are replaced by
  222.     the login directory of the matched user.  This is called a _t_i_l_d_e _s_u_b_s_t_i_-
  223.     _t_u_t_i_o_n.  If no match is found, the original text is left unchanged.  A
  224.     ``~'' by itself, or in front of a ``/'', is replaced by the value of the
  225.     HHOOMMEE parameter.  A ``~'' followed by a ``+'' or ``-'' is replaced by $$PPWWDD
  226.     and $$OOLLDDPPWWDD respectively.
  227.  
  228.     In addition, tilde substitution is attempted when the value of a _v_a_r_i_a_b_l_e
  229.     _a_s_s_i_g_n_m_e_n_t _p_a_r_a_m_e_t_e_r begins with a ``~''.
  230.  
  231.     _C_o_m_m_a_n_d _s_u_b_s_t_i_t_u_t_i_o_n
  232.  
  233.     The standard output from a command enclosed in parentheses preceded by a
  234.     dollar sign ($) or a pair of grave accents (``) may be used as part or
  235.     all of a word; trailing new-lines are removed.  In the second (archaic)
  236.     form, the string between the quotes is processed for special quoting
  237.     characters before the command is executed.  (See ``Quoting''.)  The com-
  238.     mand substitution $$((ccaatt _ff_ii_ll_ee)) can be replaced by the equivalent but fas-
  239.     ter $$((<<_ff_ii_ll_ee)).  Command substitution of most special commands that do not
  240.     perform input/output redirection are carried out without creating a
  241.     separate process.
  242.  
  243.     An arithmetic expression enclosed in double parentheses preceded by a
  244.     dollar sign ( $$((((_ee_xx_pp_rr)))) ) is replaced by the value of the arithmetic
  245.     expression within the double parentheses.
  246.  
  247.     _P_a_r_a_m_e_t_e_r _s_u_b_s_t_i_t_u_t_i_o_n
  248.  
  249.     A parameter is an _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr, one or more digits, or any of the charac-
  250.     ters **, @@, ##, ??, --, $$, and !!.  A _n_a_m_e_d parameter (a parameter denoted by
  251.     an identifier) has a value and zero or more attributes.  Named parameters
  252.     can be assigned values and attributes by using the ttyyppeesseett special com-
  253.     mand.  The attributes supported by the shell are described later with the
  254.     ttyyppeesseett special command.  Exported parameters pass values and attributes
  255.     to the environment.
  256.  
  257.     The shell supports a one-dimensional array facility.  An element of an
  258.     array parameter is referenced by a _s_u_b_s_c_r_i_p_t.  A subscript is denoted by
  259.     a ``['', followed by an arithmetic expression (see ``Arithmetic evalua-
  260.     tion'' below) followed by a ``]''.  To assign values to an array, use
  261.     sseett --AA _nn_aa_mm_ee _vv_aa_ll_uu_ee ... .  The value of all subscripts must be in the range
  262.     of 0 through 1023.  Arrays need not be declared.  Any reference to a
  263.     named parameter with a valid subscript is legal and an array will be cre-
  264.     ated if necessary.  Referencing an array without a subscript is
  265.     equivalent to referencing the element zero.
  266.  
  267.     The value of a named parameter may also be assigned by writing:
  268.  
  269.        nnaammee == _vv_aa_ll_uu_ee [ nnaammee == _vv_aa_ll_uu_ee ] ...
  270.  
  271.     If the integer attribute, --ii, is set for _nn_aa_mm_ee the _vv_aa_ll_uu_ee is subject to
  272.     arithmetic evaluation as described below.
  273.  
  274.     Positional parameters, parameters denoted by a number, may be assigned
  275.     values with the sseett special command.  Parameter $$00 is set from argument
  276.     zero when the shell is invoked.
  277.  
  278.     The character ``$'' is used to introduce substitutable parameters.
  279.  
  280.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr}}
  281.          The shell reads all the characters from ``${'' to the matching ``}''
  282.          as part of the same word even if it contains braces or metacharac-
  283.          ters.  The value, if any, of the parameter is substituted.  The
  284.          braces are required when _pp_aa_rr_aa_mm_ee_tt_ee_rr is followed by a letter, digit,
  285.          or underscore that is not to be interpreted as part of its name or
  286.          when a named parameter is subscripted.  If _pp_aa_rr_aa_mm_ee_tt_ee_rr is one or more
  287.          digits then it is a positional parameter.  A positional parameter of
  288.          more than one digit must be enclosed in braces.  If _pp_aa_rr_aa_mm_ee_tt_ee_rr is
  289.          ``*'' or ``@'', then all the positional parameters, starting with
  290.          $$11, are substituted (separated by a field separator character).  If
  291.          an array identifier with subscript ``*'' or ``@'' is used, then the
  292.          value for each of the elements is substituted (separated by a field
  293.          separator character).
  294.  
  295.     $${{##_pp_aa_rr_aa_mm_ee_tt_ee_rr}}
  296.          If _pp_aa_rr_aa_mm_ee_tt_ee_rr is ``*'' or ``@'', the number of positional parameters
  297.          is substituted.  Otherwise, the length of the value of the parameter
  298.          is substituted.
  299.  
  300.     $${{##_ii_dd_ee_nn_tt_ii_ff_ii_ee_rr[[**]]}}
  301.          The number of elements in the array identifier is substituted.
  302.  
  303.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr::--_ww_oo_rr_dd}}
  304.          If _pp_aa_rr_aa_mm_ee_tt_ee_rr is set and is non-null then substitute its value; oth-
  305.          erwise substitute _ww_oo_rr_dd.
  306.  
  307.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr::==_ww_oo_rr_dd}}
  308.          If _pp_aa_rr_aa_mm_ee_tt_ee_rr is not set or is null then set it to _ww_oo_rr_dd; the value of
  309.          the parameter is then substituted.  Positional parameters may not be
  310.          assigned to in this way.
  311.  
  312.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr::??_ww_oo_rr_dd}}
  313.          If _pp_aa_rr_aa_mm_ee_tt_ee_rr is set and is non-null then substitute its value; oth-
  314.          erwise, print _ww_oo_rr_dd and exit from the shell.  If _ww_oo_rr_dd is omitted then
  315.          a standard message is printed.
  316.  
  317.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr::++_ww_oo_rr_dd}}
  318.          If _pp_aa_rr_aa_mm_ee_tt_ee_rr is set and is non-null then substitute _ww_oo_rr_dd; otherwise
  319.          substitute nothing.
  320.  
  321.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr##_pp_aa_tt_tt_ee_rr_nn}}
  322.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr####_pp_aa_tt_tt_ee_rr_nn}}
  323.          If the shell pattern matches the beginning of the value of _pp_aa_rr_aa_mm_ee_--
  324.          _tt_ee_rr, then the value of this substitution is the value of the parame-
  325.          ter with the matched portion deleted; otherwise the value of this
  326.          parameter is substituted.  In the first form the smallest matching
  327.          pattern is deleted and in the second form the largest matching pat-
  328.          tern is deleted.
  329.  
  330.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr%%_pp_aa_tt_tt_ee_rr_nn}}
  331.     $${{_pp_aa_rr_aa_mm_ee_tt_ee_rr%%%%_pp_aa_tt_tt_ee_rr_nn}}
  332.          If the shell pattern matches the end of the value of _pp_aa_rr_aa_mm_ee_tt_ee_rr, then
  333.          the value of this substitution is the value of the _pp_aa_rr_aa_mm_ee_tt_ee_rr with
  334.          the matched part deleted; otherwise substitute the value of parame-
  335.          ter.  In the first form the smallest matching pattern is deleted and
  336.          in the second form the largest matching pattern is deleted.
  337.  
  338.     In the above, _ww_oo_rr_dd is not evaluated unless it is to be used as the sub-
  339.     stituted string, so that, in the following example, ppwwdd is executed only
  340.     if dd is not set or is null:
  341.  
  342.        eecchhoo $${{dd::--$$((ppwwdd))}}
  343.  
  344.     If the colon (:) is omitted from the above expressions, then the shell
  345.     only checks whether _pp_aa_rr_aa_mm_ee_tt_ee_rr is set or not.
  346.  
  347.     The following parameters are automatically set by the shell:
  348.  
  349.     ##           The number of positional parameters in decimal.
  350.  
  351.     --           Flags supplied to the shell on invocation or by the sseett com-
  352.                 mand.
  353.  
  354.     ??           The decimal value returned by the last executed command.
  355.  
  356.     $$           The process number of this shell.
  357.  
  358.     __           Initially, the value ``_'' is the absolute pathname of the
  359.                 shell or script being executed as passed in the environment.
  360.                 Subsequently it is assigned the last argument of the previous
  361.                 command.  This parameter is not set for commands which are
  362.                 asynchronous.  This parameter is also used to hold the name
  363.                 of the matching MMAAIILL file when checking for mail.
  364.  
  365.     !!           The process number of the last background command invoked.
  366.  
  367.     EERRRRNNOO       The value of eerrrrnnoo as set by the most recent failed system
  368.                 call.  This value is system dependent and is intended for
  369.                 debugging purposes.
  370.  
  371.     LLIINNEENNOO      The line number of the current line within the script or
  372.                 function being executed.
  373.  
  374.     OOLLDDPPWWDD      The previous working directory set by the ccdd command.
  375.  
  376.     OOPPTTAARRGG      The value of the last option argument processed by the
  377.                 ggeettooppttss special command.
  378.  
  379.     OOPPTTIINNDD      The index of the last option argument processed by the
  380.                 ggeettooppttss special command.
  381.  
  382.     PPPPIIDD        The process number of the parent of the shell.
  383.  
  384.     PPWWDD         The present working directory set by the ccdd command.
  385.  
  386.     RRAANNDDOOMM      Each time this parameter is referenced, a random integer,
  387.                 uniformly distributed between 0 and 32767, is generated.  The
  388.                 sequence of random numbers can be initialized by assigning a
  389.                 numeric value to RRAANNDDOOMM.
  390.  
  391.     RREEPPLLYY       This parameter is set by the sseelleecctt statement and by the rreeaadd
  392.                 special command when no arguments are supplied.
  393.  
  394.     SSEECCOONNDDSS     Each time this parameter is referenced, the number of seconds
  395.                 since shell invocation is returned.  If this parameter is
  396.                 assigned a value, then the value returned upon reference will
  397.                 be the value that was assigned plus the number of seconds
  398.                 since the assignment.
  399.  
  400.     The following parameters are used by the shell:
  401.  
  402.     CCDDPPAATTHH      The search path for the ccdd command.
  403.  
  404.     CCOOLLUUMMNNSS     If this variable is set, the value is used to define the
  405.                 width of the edit window for the shell edit modes and for
  406.                 printing select lists.
  407.  
  408.     EEDDIITTOORR      If the value of this variable ends in eemmaaccss, ggmmaaccss, or vvii and
  409.                 the VVIISSUUAALL variable is not set, then the corresponding option
  410.                 (see ``Special commands'' -- sseett below) will be turned on.
  411.  
  412.     EENNVV         If this parameter is set, then parameter substitution is per-
  413.                 formed on the value to generate the pathname of the script
  414.                 that will be executed when the shell is invoked.  (See
  415.                 ``Invocation'' below.)  This file is typically used for alias
  416.                 and function definitions.
  417.  
  418.     FFCCEEDDIITT      The default editor name for the ffcc command.
  419.  
  420.     FFPPAATTHH       The search path for function definitions.  This path is
  421.                 searched when a function with the --uu attribute is referenced
  422.                 and when a command is not found.  If an executable file is
  423.                 found, then it is read and executed in the current environ-
  424.                 ment.
  425.  
  426.     IIFFSS         Internal field separators, normally ssppaaccee, ttaabb, and nneeww--lliinnee,
  427.                 that are used to separate command words which result from
  428.                 command or parameter substitution, and for separating words
  429.                 with the special command rreeaadd.  The first character of the
  430.                 IIFFSS parameter is used to separate arguments for the $$** sub-
  431.                 stitution. (See ``Quoting'' below.)
  432.  
  433.     HHIISSTTFFIILLEE    If this parameter is set when the shell is invoked, then the
  434.                 value is the pathname of the file that will be used to store
  435.                 the command history.  (See ``Command re-entry'' below.)
  436.  
  437.     HHIISSTTSSIIZZEE    If this parameter is set when the shell is invoked, then the
  438.                 number of previously entered commands that are accessible by
  439.                 this shell will be greater than or equal to this number.  The
  440.                 default is 128.
  441.  
  442.     HHOOMMEE        The default argument (home directory) for the ccdd command.
  443.  
  444.     LLIINNEESS       If this variable is set, the value is used to determine the
  445.                 column length for printing sseelleecctt lists.  sseelleecctt lists will
  446.                 print vertically until about two-thirds of LLIINNEESS lines are
  447.                 filled.
  448.  
  449.     MMAAIILL        If this parameter is set to the name of a mail file and the
  450.                 MMAAIILLPPAATTHH parameter is not set, then the shell informs the
  451.                 user of arrival of mail in the specified file.
  452.  
  453.     MMAAIILLCCHHEECCKK   This variable specifies how often (in seconds) the shell will
  454.                 check for changes in the modification time of any of the
  455.                 files specified by the MMAAIILLPPAATTHH or MMAAIILL parameters.  The
  456.                 default value is 600 seconds. When the time has elapsed the
  457.                 shell will check before issuing the next prompt.
  458.  
  459.     MMAAIILLPPAATTHH    A colon (:) separated list of file names.  If this parameter
  460.                 is set then the shell informs the user of any modifications
  461.                 to the specified files that have occurred within the last
  462.                 MMAAIILLCCHHEECCKK seconds.  Each file name can be followed by a ``?''
  463.                 and a message that will be printed.  The message will undergo
  464.                 parameter substitution with the parameter $$__ defined as the
  465.                 name of the file that has changed.  The default message is
  466.  
  467.                 you have mail in $_.
  468.  
  469.     PPAATTHH        The search path for commands (see ``Execution'' below).  The
  470.                 user may not change PPAATTHH if executing under rrkksshh (except in
  471.                 ._p_r_o_f_i_l_e).
  472.  
  473.     PPSS11         The value of this parameter is expanded for parameter substi-
  474.                 tution to define the primary prompt string which by default
  475.                 is ``$ '' (dollar-space).  The character ``!'' in the primary
  476.                 prompt string is replaced by the command number (see ``Com-
  477.                 mand re-entry'' below).
  478.  
  479.     PPSS22         Secondary prompt string, by default ``>> ''.
  480.  
  481.     PPSS33         Selection prompt string used within a sseelleecctt loop, by default
  482.                 ``##?? ''.
  483.  
  484.     PPSS44         The value of this parameter is expanded for parameter substi-
  485.                 tution and precedes each line of an execution trace.  If
  486.                 omitted, the execution trace prompt is ``++ ''.
  487.  
  488.     SSHHEELLLL       The pathname of the shell is kept in the environment.  At
  489.                 invocation, if the basename of this variable matches the pat-
  490.                 tern **rr**sshh, then the shell becomes restricted.
  491.  
  492.     TTMMOOUUTT       If TTMMOOUUTT is set to a value greater than zero, the shell will
  493.                 terminate if a command is not entered within the prescribed
  494.                 number of seconds after issuing the PPSS11 prompt.  (Note that
  495.                 the shell can be compiled with a maximum bound for this value
  496.                 which cannot be exceeded.)
  497.  
  498.     VVIISSUUAALL      If the value of this variable ends in eemmaaccss, ggmmaaccss, or vvii,
  499.                 then the corresponding option (see ``Special commands''
  500.                 below) will be turned on.
  501.  
  502.     The shell gives default values to PPAATTHH, PPSS11, PPSS22, MMAAIILLCCHHEECCKK, TTMMOOUUTT and
  503.     IIFFSS, while HHOOMMEE, SSHHEELLLL, EENNVV, and MMAAIILL are not set at all by the shell
  504.     (although HHOOMMEE, MMAAIILL, and SSHHEELLLL are set by llooggiinn(M)).
  505.  
  506.     _B_l_a_n_k _i_n_t_e_r_p_r_e_t_a_t_i_o_n
  507.  
  508.     After parameter and command substitution, the results of substitutions
  509.     are scanned for field separator characters (those found in IIFFSS) and split
  510.     into distinct arguments where such characters are found.
  511.  
  512.     Explicit null arguments ("""" or '''') are retained.  Implicit null arguments
  513.     (those resulting from parameters that have no values) are removed.
  514.  
  515.     _F_i_l_e _n_a_m_e _g_e_n_e_r_a_t_i_o_n
  516.  
  517.     Following substitution, each command word is scanned for the characters
  518.     **, ??, and [[ unless the --ff option has been set.  If one of these charac-
  519.     ters appears then the word is regarded as a pattern.  The word is
  520.     replaced with lexicographically sorted file names that match the pattern.
  521.     If no file name is found that matches the pattern, then the word is left
  522.     unchanged.  When a pattern is used for file name generation, the charac-
  523.     ter ``.''  at the start of a file name or immediately following a ``/'',
  524.     as well as the character ``/'' itself, must be matched explicitly.  In
  525.     other instances of pattern matching the ``/'' and ``.''  are not treated
  526.     specially.
  527.  
  528.     *     Matches any string, including the null string.
  529.  
  530.     ?     Matches any single character.
  531.  
  532.     [[...]] Matches any one of the enclosed characters.  A pair of characters
  533.           separated by ``-'' matches any character lexically between the
  534.           pair, inclusive.  If the first character following the opening "[ "
  535.           is a "! " then any character not enclosed is matched. A ``-'' can
  536.           be included in the character set by putting it as the first or last
  537.           character.
  538.     A _pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt is a list of one or more patterns separated from each
  539.     other with a ``|''.  Composite patterns can be formed with one or more of
  540.     the following:
  541.  
  542.     ??((_pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt)) Optionally matches any one of the given patterns.
  543.  
  544.     **((_pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt)) Matches zero or more occurrences of the given patterns.
  545.  
  546.     ++((_pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt)) Matches one or more occurrences of the given patterns.
  547.  
  548.     @@((_pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt)) Matches exactly one of the given patterns.
  549.  
  550.     !!((_pp_aa_tt_tt_ee_rr_nn_--_ll_ii_ss_tt)) Matches anything, except one of the given patterns.
  551.  
  552.     _Q_u_o_t_i_n_g
  553.  
  554.     Each of the specified metacharacters (See ``Definitions'' above) has a
  555.     special meaning to the shell and causes termination of a word unless
  556.     quoted.  A character may be quoted (that is, made to stand for itself) by
  557.     preceding it with a backslash (\).  The pair ``\<Enter>'' is ignored.
  558.     All characters enclosed between a pair of single quote marks ('' '') are
  559.     quoted.  A single quote cannot appear within single quotes.  Inside dou-
  560.     ble quote marks (""), parameter and command substitution occur and ``\''
  561.     quotes the characters \, ', " and $.  The meaning of $$** and $$@@ is identi-
  562.     cal when not quoted or when used as a parameter assignment value or as a
  563.     file name.  However, when used as a command argument, $$** is equivalent to
  564.     "$$11_dd$$22_dd......", where _dd is the first character of the IIFFSS parameter, whereas
  565.     $$@@ is equivalent to "$1" "$2"....  Inside grave quote marks (` `) \
  566.     quotes the characters \, `, and $.  If the grave quotes occur within dou-
  567.     ble quotes then \ also quotes the character ".
  568.  
  569.     The special meaning of reserved words or aliases can be removed by quot-
  570.     ing any character of the reserved word.  The recognition of function
  571.     names or special command names listed below cannot be altered by quoting
  572.     them.
  573.  
  574.     _A_r_i_t_h_m_e_t_i_c _e_v_a_l_u_a_t_i_o_n
  575.  
  576.     An ability to perform integer arithmetic is provided with the special
  577.     command lleett.  Evaluations are performed using long arithmetic.  Constants
  578.     are of the form [_bb_aa_ss_ee##]_nn where _bb_aa_ss_ee is a decimal number between two and
  579.     thirty-six representing the arithmetic base and _nn is a number in that
  580.     base.  If _bb_aa_ss_ee is omitted then base 10 is used.
  581.  
  582.     An arithmetic expression uses the syntax, precedence, and associativity
  583.     of expression of the C language.  All the integral operators, other than
  584.     ++++, ----, ??::, and comma (,) are supported.  Named parameters can be refer-
  585.     enced by name within an arithmetic expression without using the parameter
  586.     substitution syntax.  When a named parameter is referenced, its value is
  587.     evaluated as an arithmetic expression.
  588.  
  589.     An internal integer representation of a named parameter can be specified
  590.     with the --ii option of the ttyyppeesseett special command.  Arithmetic evaluation
  591.     is performed on the value of each assignment to a named parameter with
  592.     the --ii attribute.  If you do not specify an arithmetic base, the first
  593.     assignment to the parameter determines the arithmetic base.  This base is
  594.     used when parameter substitution occurs.
  595.  
  596.     Since many of the arithmetic operators require quoting, an alternative
  597.     form of the lleett command is provided.  For any command which begins with a
  598.     ((((, all the characters until a matching )))) are treated as a quoted
  599.     expression.  More precisely, ((((...)))) is equivalent to lleett ""..."".
  600.  
  601.     _P_r_o_m_p_t_i_n_g
  602.  
  603.     When used interactively, the shell prompts with the value of PPSS11 before
  604.     reading a command.  If at any time a new-line is typed and further input
  605.     is needed to complete a command, then the secondary prompt (that is, the
  606.     value of PPSS22) is issued.
  607.  
  608.     _C_o_n_d_i_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n_s
  609.  
  610.     A conditional expression is used with the [[[[ compound command to test
  611.     attributes of files and to compare strings.  Word splitting and file name
  612.     generation are not performed on the words between [[[[ and ]]]].  Each
  613.     expression can be constructed from one or more of the following unary or
  614.     binary expressions:
  615.  
  616.     --aa _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists.
  617.  
  618.     --bb _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is a block special file.
  619.  
  620.     --cc _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is a character special file.
  621.  
  622.     --dd _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is a directory.
  623.  
  624.     --ff _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is an ordinary file.
  625.  
  626.     --gg _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is has its sseettggiidd bit set.
  627.  
  628.     --kk _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is has its ssttiicckkyy bit set.
  629.  
  630.     --nn _ss_tt_rr_ii_nn_gg       True, if length of _ss_tt_rr_ii_nn_gg is non-zero.
  631.  
  632.     --oo _oo_pp_tt_ii_oo_nn       True, if option named _oo_pp_tt_ii_oo_nn is on.
  633.  
  634.     --pp _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is a fifo special file or a
  635.                     pipe.
  636.  
  637.     --rr _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is readable by current process.
  638.  
  639.     --ss _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and has size greater than zero.
  640.  
  641.     --tt _ff_ii_ll_dd_ee_ss       True, if file descriptor number _ff_ii_ll_dd_ee_ss is open and asso-
  642.                     ciated with a terminal device.
  643.  
  644.     --uu _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is has its sseettuuiidd bit set.
  645.  
  646.     --ww _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is writable by current process.
  647.  
  648.     --xx _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is executable by current pro-
  649.                     cess.  If _ff_ii_ll_ee exists and is a directory, then the
  650.                     current process has permission to search in the direc-
  651.                     tory.
  652.  
  653.     --zz _ss_tt_rr_ii_nn_gg       True, if length of _ss_tt_rr_ii_nn_gg is zero.
  654.  
  655.     --LL _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is a symbolic link.
  656.  
  657.     --OO _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and is owned by the effective user
  658.                     id of this process.
  659.  
  660.     --GG _ff_ii_ll_ee         True, if _ff_ii_ll_ee exists and its group matches the effective
  661.                     group id of this process.
  662.  
  663.     _ff_ii_ll_ee_11 --nntt _ff_ii_ll_ee_22 True, if _ff_ii_ll_ee_11 exists and is newer than _ff_ii_ll_ee_22.
  664.  
  665.     _ff_ii_ll_ee_11 --oott _ff_ii_ll_ee_22 True, if _ff_ii_ll_ee_11 exists and is older than _ff_ii_ll_ee_22.
  666.  
  667.     _ff_ii_ll_ee_11 --eeff _ff_ii_ll_ee_22 True, if _ff_ii_ll_ee_11 and _ff_ii_ll_ee_22 exist and refer to the same
  668.                     file.
  669.  
  670.     _ss_tt_rr_ii_nn_gg == _pp_aa_tt_tt_ee_rr_nn
  671.                     True, if _ss_tt_rr_ii_nn_gg matches _pp_aa_tt_tt_ee_rr_nn.
  672.  
  673.     _ss_tt_rr_ii_nn_gg !!== _pp_aa_tt_tt_ee_rr_nn
  674.                     True, if _ss_tt_rr_ii_nn_gg does not match _pp_aa_tt_tt_ee_rr_nn.
  675.  
  676.     _ss_tt_rr_ii_nn_gg_11 << _ss_tt_rr_ii_nn_gg_22
  677.                     True, if _ss_tt_rr_ii_nn_gg_11 comes before _ss_tt_rr_ii_nn_gg_22 based on ASCII
  678.                     value of their characters.
  679.  
  680.     _ss_tt_rr_ii_nn_gg_11 >> _ss_tt_rr_ii_nn_gg_22
  681.                     True, if _ss_tt_rr_ii_nn_gg_11 comes after _ss_tt_rr_ii_nn_gg_22 based on ASCII value
  682.                     of their characters.
  683.  
  684.     _ee_xx_pp_11 --eeqq _ee_xx_pp_22   True, if _ee_xx_pp_11 is equal to _ee_xx_pp_22.
  685.  
  686.     _ee_xx_pp_11 --nnee _ee_xx_pp_22   True, if _ee_xx_pp_11 is not equal to _ee_xx_pp_22.
  687.  
  688.     _ee_xx_pp_11 --lltt _ee_xx_pp_22   True, if _ee_xx_pp_11 is less than _ee_xx_pp_22.
  689.  
  690.     _ee_xx_pp_11 --ggtt _ee_xx_pp_22   True, if _ee_xx_pp_11 is greater than _ee_xx_pp_22.
  691.  
  692.     _ee_xx_pp_11 --llee _ee_xx_pp_22   True, if _ee_xx_pp_11 is less than or equal to _ee_xx_pp_22.
  693.  
  694.     _ee_xx_pp_11 --ggee _ee_xx_pp_22   True, if _ee_xx_pp_11 is greater than or equal to _ee_xx_pp_22.
  695.  
  696.     In each of the above expressions, if _ff_ii_ll_ee is of the form /_d_e_v/_f_d/_nn, where
  697.     _nn is an integer, then the test is applied to the open file whose descrip-
  698.     tor number is _nn.
  699.  
  700.     A compound expression can be constructed from these primitives by using
  701.     any of the following, listed in decreasing order of precedence.
  702.  
  703.     ((_ee_xx_pp_rr_ee_ss_ss_ii_oo_nn))    True, if _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn is true. Used to group expressions.
  704.  
  705.     !! _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn    True if _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn is false.
  706.  
  707.     _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_11 &&&& _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_22
  708.                     True, if _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_11 and _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_22 are both true.
  709.  
  710.     _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_11 |||| _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_22
  711.                     True, if either _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_11 or _ee_xx_pp_rr_ee_ss_ss_ii_oo_nn_22 is true.
  712.  
  713.     _S_p_e_l_l_i_n_g _c_h_e_c_k_e_r
  714.  
  715.     By default, the shell checks spelling whenever you use ccdd to change
  716.     directories.  For example, if you change to a different directory using
  717.     ccdd and misspell the directory name, the shell responds with an
  718.     alternative spelling of an existing directory. Enter ``y'' and press
  719.     <Return> (or just press <Return>) to change to the offered directory.  If
  720.     the offered spelling is incorrect, enter ``n'', then retype the command
  721.     line.  In this example the user input is boldfaced:
  722.  
  723.        # ccdd //uussrr//ssppooll//uuuuccpp
  724.        /usr/spool/uucp? yy
  725.        ok
  726.  
  727.     The spell check feature is controlled by the CCDDSSPPEELLLL environment vari-
  728.     able. The default value of CCDDSSPPEELLLL is set to the string ``cdspell'' when-
  729.     ever a kksshh session is run. A user can change it to any value, including
  730.     the null string, but the value is immaterial:  if CCDDSSPPEELLLL is set to any
  731.     value, the spell check feature is engaged.
  732.  
  733.     To disable the spelling checker, enter the following at the kksshh prompt :
  734.  
  735.        uunnsseett CCDDSSPPEELLLL
  736.  
  737.     When the user does a sseett at the kksshh prompt, CCDDSSPPEELLLL is not listed if the
  738.     uunnsseett was successful.
  739.  
  740.     _I_n_p_u_t/_o_u_t_p_u_t
  741.  
  742.     Before a command is executed, its input and output may be redirected
  743.     using a special notation interpreted by the shell.  The following may
  744.     appear anywhere in a simple-command or may precede or follow a command,
  745.     and are not passed on to the invoked command.  Command and parameter sub-
  746.     stitution occurs before _ww_oo_rr_dd or _dd_ii_gg_ii_tt is used, except as noted below.
  747.     File name generation occurs only if the pattern matches a single file and
  748.     blank interpretation is not performed.
  749.  
  750.     <<_ww_oo_rr_dd         Use file _ww_oo_rr_dd as standard input (file descriptor 0).
  751.  
  752.     >>_ww_oo_rr_dd         Use file _ww_oo_rr_dd as standard output (file descriptor 1).  If
  753.                   the file does not exist then it is created.  If the file
  754.                   exists, and the nnoocclloobbbbeerr option is on, this causes an
  755.                   error; otherwise, it is truncated to zero length.
  756.  
  757.     >>||_ww_oo_rr_dd        Same as >>, except that it overrides the nnoocclloobbbbeerr option.
  758.  
  759.     >>>>_ww_oo_rr_dd        Use file _ww_oo_rr_dd as standard output.  If the file exists then
  760.                   output is appended to it (by first seeking to the end-of-
  761.                   file); otherwise, the file is created.
  762.  
  763.     <<>>_ww_oo_rr_dd        Open file _ww_oo_rr_dd for reading and writing as standard input.
  764.  
  765.     <<<<[--]_ww_oo_rr_dd     The shell input is read up to a line that is the same as
  766.                   _ww_oo_rr_dd, or to an end-of-file.  No parameter substitution,
  767.                   command substitution or file name generation is performed
  768.                   on _ww_oo_rr_dd.  The resulting document, called a _h_e_r_e-_d_o_c_u_m_e_n_t,
  769.                   becomes the standard input.  If any character of _ww_oo_rr_dd is
  770.                   quoted, then no interpretation is placed upon the charac-
  771.                   ters of the document; otherwise, parameter and command sub-
  772.                   stitution occurs, \\nneeww--lliinnee is ignored, and ``\'' must be
  773.                   used to quote the characters \, $, `, and the first charac-
  774.                   ter of _ww_oo_rr_dd.  If ``-'' is appended to <<<<, then all leading
  775.                   tabs are stripped from _ww_oo_rr_dd and from the document.
  776.  
  777.     <<&&_dd_ii_gg_ii_tt       The standard input is duplicated from file descriptor _dd_ii_gg_ii_tt
  778.                   (see dduupp(S)).  Similarly for the standard output using
  779.                   >>&&_dd_ii_gg_ii_tt.
  780.  
  781.     <<&&--           The standard input is closed.  Similarly for the standard
  782.                   output using >>&&--.
  783.  
  784.     <<&&pp           The input from the co-process is moved to standard input.
  785.  
  786.     >>&&pp           The output to the co-process is moved to standard output.
  787.  
  788.     If one of the above is preceded by a digit, then the file descriptor num-
  789.     ber referred to is that specified by the digit (instead of the default 0
  790.     or 1).  For example:
  791.  
  792.        ... 2>&1
  793.  
  794.     means file descriptor 2 is to be opened for writing as a duplicate of
  795.     file descriptor 1.
  796.  
  797.     File descriptor 0 is standard input; 1 is standard output; 2 is standard
  798.     error.
  799.  
  800.     The order in which redirections are specified is significant.  The shell
  801.     evaluates each redirection in terms of the file descriptor, file associa-
  802.     tion at the time of evaluation.  For example:
  803.  
  804.        ... 1>_f_n_a_m_e 2>&1
  805.  
  806.     first associates file descriptor 1 with file _f_n_a_m_e.  It then associates
  807.     file descriptor 2 with the file associated with file descriptor 1 (that
  808.     is, _f_n_a_m_e).  If the order of redirections were reversed, file descriptor
  809.     2 would be associated with the terminal (assuming this was the initial
  810.     state of file descriptor 1) and then file descriptor 1 would be associ-
  811.     ated with file _f_n_a_m_e.
  812.  
  813.     If a command is followed by ``&'' and job control is not active, then the
  814.     default standard input for the command is the empty file /_d_e_v/_n_u_l_l.  Oth-
  815.     erwise, the environment for the execution of a command contains the file
  816.     descriptors of the invoking shell as modified by input/output specifica-
  817.     tions.
  818.  
  819.     _E_n_v_i_r_o_n_m_e_n_t
  820.  
  821.     The environment (see eennvviirroonn(M)) is a list of name-value pairs that is
  822.     passed to an executing process in the same way as a normal argument list.
  823.     The names must be identifiers and the values are character strings.  The
  824.     shell interacts with the environment in several ways.  On invocation, the
  825.     shell scans the environment and creates a parameter for each name found,
  826.     giving it the corresponding value and marking it _e_x_p_o_r_t.  Executed com-
  827.     mands inherit the environment.  If the user modifies the values of these
  828.     parameters or creates new ones, using the eexxppoorrtt or ttyyppeesseett--xx commands
  829.     they become part of the environment.  The environment seen by any exe-
  830.     cuted command is thus composed of any name-value pairs originally inher-
  831.     ited by the shell, whose values may be modified by the current shell,
  832.     plus any additions which must be noted in eexxppoorrtt or ttyyppeesseett--xx commands.
  833.  
  834.     The environment for any simple-command or function may be augmented by
  835.     prefixing it with one or more parameter assignments.  A parameter assign-
  836.     ment argument is a word of the form _ii_dd_ee_nn_tt_ii_ff_ii_ee_rr_==_vv_aa_ll_uu_ee.  Thus:
  837.  
  838.        TTEERRMM=wwyy6600 _cc_mm_dd _aa_rr_gg_ss
  839.  
  840.     and
  841.  
  842.        (eexxppoorrtt TTEERRMM; TTEERRMM=wwyy6600; _cc_mm_dd _aa_rr_gg_ss)
  843.  
  844.     are equivalent (as far as the above execution of _cc_mm_dd is concerned, except
  845.     for commands listed with {1} or {2} in the ``Special commands'' section).
  846.  
  847.     If the --kk flag is set, all parameter assignment arguments are placed in
  848.     the environment, even if they occur after the command name.  The follow-
  849.     ing first prints a=b c and then c:
  850.  
  851.        echo  a=b  c
  852.        set  -k
  853.        echo  a=b  c
  854.  
  855.     This feature is intended for use with scripts written for early versions
  856.     of the shell and its use in new scripts is strongly discouraged.  It is
  857.     likely to disappear in the future.
  858.  
  859.     _F_u_n_c_t_i_o_n_s
  860.  
  861.     The ffuunnccttiioonn reserved word, described in the ``Commands'' section above,
  862.     is used to define shell functions.  Shell functions are read in and
  863.     stored internally.  Alias names are resolved when the function is read.
  864.     Functions are executed like commands with the arguments passed as posi-
  865.     tional parameters.  (See ``Execution'' below.)
  866.  
  867.     Functions execute in the same process as the caller and share all files
  868.     and the present working directory with the caller.  Traps caught by the
  869.     caller are reset to their default action inside the function.  A trap
  870.     condition that is not caught or ignored by the function causes the func-
  871.     tion to terminate and the condition to be passed on to the caller.  A
  872.     trap on EEXXIITT set inside a function is executed after the function com-
  873.     pletes in the environment of the caller.  Ordinarily, variables are
  874.     shared between the calling program and the function.  However, the
  875.     ttyyppeesseett special command used within a function defines local variables
  876.     whose scope includes the current function and all functions it calls.
  877.  
  878.     The special command rreettuurrnn is used to return from function calls.  Errors
  879.     within functions return control to the caller.
  880.  
  881.     Function identifiers can be listed with the --ff or ++ff option of the
  882.     ttyyppeesseett special command.  The text of functions will also be listed with
  883.     --ff.  Function can be undefined with the --ff option of the uunnsseett special
  884.     command.
  885.  
  886.     Ordinarily, functions are unset when the shell executes a shell script.
  887.     The --xxff option of the ttyyppeesseett command allows a function to be exported to
  888.     scripts that are executed without a separate invocation of the shell.
  889.     Functions that need to be defined across separate invocations of the
  890.     shell should be specified in the EENNVV file with the --xxff option of ttyyppeesseett.
  891.  
  892.     _J_o_b_s
  893.  
  894.     If the mmoonniittoorr option of the sseett command is turned on, an interactive
  895.     shell associates a ``job'' with each pipeline.  It keeps a table of
  896.     current jobs, printed by the jjoobbss command, and assigns them small integer
  897.     numbers.  When a job is started asynchronously with ``&'', the shell
  898.     prints a line which looks like:
  899.  
  900.        [1] 1234
  901.  
  902.     indicating that the job which was started asynchronously was job number 1
  903.     and had one (top-level) process, whose process id was 1234.
  904.  
  905.     If you are running a job and wish to do something else you may hit the
  906.     key ^^ZZ (<Ctrl>zz) which sends a SSTTOOPP signal to the current job.  (This is
  907.     known as the suspend character, and is ^Z by default; this can be changed
  908.     in the ssttttyy ssuusspp line in a user's ._p_r_o_f_i_l_e file.)  The shell will then
  909.     normally indicate that the job has been `Stopped', and print another
  910.     prompt.  You can then manipulate the state of this job, putting it in the
  911.     background with the bbgg command, or run some other commands and then even-
  912.     tually bring the job back into the foreground with the foreground command
  913.     ffgg.  A ^^ZZ takes effect immediately and is like an interrupt in that pend-
  914.     ing output and unread input are discarded when it is typed.
  915.  
  916.     A job being run in the background will stop if it tries to read from the
  917.     terminal.  Background jobs are normally allowed to produce output, but
  918.     this can be disabled by giving the command ``stty tostop''.  If you set
  919.     this tty option, then background jobs will stop when they try to produce
  920.     output like they do when they try to read input.
  921.  
  922.     There are several ways to refer to jobs in the shell.  A job can be
  923.     referred to by the process id of any process of the job or by one of the
  924.     following:
  925.  
  926.     %%_nn_uu_mm_bb_ee_rr     The job with the given number.
  927.  
  928.     %%_ss_tt_rr_ii_nn_gg     Any job whose command line begins with _ss_tt_rr_ii_nn_gg.
  929.  
  930.     %%??_ss_tt_rr_ii_nn_gg    Any job whose command line contains _ss_tt_rr_ii_nn_gg.
  931.  
  932.     %%%%          Current job.
  933.  
  934.     %%++          Equivalent to %%%%.
  935.  
  936.     %%--          Previous job.
  937.  
  938.     The shell learns immediately whenever a process changes state.  It nor-
  939.     mally informs you whenever a job becomes blocked so that no further pro-
  940.     gress is possible, but only just before it prints a prompt.  This is done
  941.     so that it does not otherwise disturb your work.
  942.  
  943.     When the monitor mode is on, each background job that completes triggers
  944.     any trap set for CCHHLLDD.
  945.  
  946.     When you try to leave the shell while jobs are running or stopped, you
  947.     will be warned that ``You have stopped(running) jobs.''  You may use the
  948.     jjoobbss command to see what they are.  If you do this or immediately try to
  949.     exit again, the shell will not warn you a second time, and the stopped
  950.     jobs will be terminated.
  951.  
  952.     _S_i_g_n_a_l_s
  953.  
  954.     The IINNTT and QQUUIITT signals for an invoked command are ignored if the com-
  955.     mand is followed by ``&'' and the job mmoonniittoorr option is not active.  Oth-
  956.     erwise, signals have the values inherited by the shell from its parent
  957.     (but see also the ttrraapp command below).
  958.  
  959.     _E_x_e_c_u_t_i_o_n
  960.  
  961.     Each time a command is executed, the above substitutions are carried out.
  962.     If the command name matches one of the ``Special Commands'' listed below,
  963.     it is executed within the current shell process.  Next, the command name
  964.     is checked to see if it matches one of the user defined functions.  If it
  965.     does, the positional parameters are saved and then reset to the arguments
  966.     of the function call.  When the function completes or issues a return,
  967.     the positional parameter list is restored and any trap set on EEXXIITT within
  968.     the function is executed.  The value of a function is the value of the
  969.     last command executed.  A function is also executed in the current shell
  970.     process.  If a command name is not a special command or a user defined
  971.     function, a process is created and an attempt is made to execute the com-
  972.     mand via eexxeecc(S).
  973.  
  974.     The shell parameter PPAATTHH defines the search path for the directory con-
  975.     taining the command.  Alternative directory names are separated by a
  976.     colon (:).  The default path is /_b_i_n:/_u_s_r/_b_i_n: (specifying /_b_i_n,
  977.     /_u_s_r/_b_i_n, and the current directory in that order).  The current direc-
  978.     tory can be specified by two or more adjacent colons, or by a colon at
  979.     the beginning or end of the path list.  If the command name contains a
  980.     ``/'' then the search path is not used.  Otherwise, each directory in the
  981.     path is searched for an executable file.  If the file has execute permis-
  982.     sion but is not a directory or an _a._o_u_t file, it is assumed to be a file
  983.     containing shell commands.  A sub-shell is spawned to read it.  All non-
  984.     exported aliases, functions, and named parameters are removed in this
  985.     case.  If the shell command file doesn't have read permission, or if the
  986.     sseettuuiidd and/or sseettggiidd bits are set on the file, then the shell executes an
  987.     agent whose job it is to set up the permissions and execute the shell
  988.     with the shell command file passed down as an open file.  A parenthesized
  989.     command is executed in a sub-shell without removing non-exported quanti-
  990.     ties.
  991.  
  992.     _C_o_m_m_a_n_d _r_e-_e_n_t_r_y
  993.  
  994.     The text of the last HHIISSTTSSIIZZEE (default 128) commands entered from a ter-
  995.     minal device is saved in a history file.  The file $$HHOOMMEE/._s_h__h_i_s_t_o_r_y is
  996.     used if the HHIISSTTFFIILLEE variable is not set or is not writable.  A shell can
  997.     access the commands of all interactive shells which use the same named
  998.     HHIISSTTFFIILLEE.  The special command ffcc is used to list or edit a portion of
  999.     this file.  The portion of the file to be edited or listed can be
  1000.     selected by number or by giving the first character or characters of the
  1001.     command.  A single command or range of commands can be specified.  If you
  1002.     do not specify an editor program as an argument to ffcc then the value of
  1003.     the parameter FFCCEEDDIITT is used.  If FFCCEEDDIITT is not defined then /_b_i_n/_e_d is
  1004.     used.  The edited command(s) is printed and re-executed upon leaving the
  1005.     editor.  The editor name ``-'' is used to skip the editing phase and to
  1006.     re-execute the command.  In this case a substitution parameter of the
  1007.     form _oo_ll_dd=_nn_ee_ww can be used to modify the command before execution.  For
  1008.     example, if rr is aliased to ''ffcc --ee --'' then typing rr bbaadd==ggoooodd cc will re-
  1009.     execute the most recent command which starts with the letter ``c'',
  1010.     replacing the first occurrence of the string bbaadd with the string ggoooodd.
  1011.  
  1012.     _I_n-_l_i_n_e _e_d_i_t_i_n_g _o_p_t_i_o_n_s
  1013.  
  1014.     Normally, each command line entered from a terminal device is simply
  1015.     typed followed by a new-line (RREETTUURRNN or LLIINNEE FFEEEEDD).  If the eemmaaccss, ggmmaaccss,
  1016.     or vvii option is active, the user can edit the command line.  To be in one
  1017.     of these edit modes sseett the corresponding option.  An editing option is
  1018.     automatically selected each time the VVIISSUUAALL or EEDDIITTOORR variable is
  1019.     assigned a value ending in either of these option names.
  1020.  
  1021.     The editing features require that the user's terminal accept RREETTUURRNN as
  1022.     carriage return without line feed and that a space ( ) must overwrite the
  1023.     current character on the screen.  ADM terminal users should set the
  1024.     ``space - advance'' switch to `space'.  Hewlett-Packard series 2621 ter-
  1025.     minal users should set the straps to `bcGHxZ etX'.
  1026.  
  1027.     The editing modes implement a concept where the user is looking through a
  1028.     window at the current line.  The window width is the value of CCOOLLUUMMNNSS if
  1029.     it is defined, otherwise 80.  If the line is longer than the window width
  1030.     minus two, a mark is displayed at the end of the window to notify the
  1031.     user.  As the cursor moves and reaches the window boundaries the window
  1032.     will be centered about the cursor.  The mark is a ``>'' (<, *) if the
  1033.     line extends on the right (left, both) side(s) of the window.
  1034.  
  1035.     The search commands in each edit mode provide access to the history file.
  1036.     Only strings are matched, not patterns, although a leading ``^'' in the
  1037.     string restricts the match to begin at the first character in the line.
  1038.  
  1039.     _E_m_a_c_s _e_d_i_t_i_n_g _m_o_d_e
  1040.  
  1041.     This mode is entered by enabling either the eemmaaccss or ggmmaaccss option.  The
  1042.     only difference between these two modes is the way they handle ^^TT.  To
  1043.     edit, the user moves the cursor to the point needing correction and then
  1044.     inserts or deletes characters or words as needed.  All the editing com-
  1045.     mands are control characters or escape sequences.  The notation for con-
  1046.     trol characters is caret (^^) followed by the character.  For example, ^^FF
  1047.     is the notation for control FF.  This is entered by depressing `f' while
  1048.     holding down the <Ctrl> (control) key. The <Shift> key is _n_o_t depressed.
  1049.     (The notation ^^?? indicates the <Del> (delete) key.)
  1050.  
  1051.     The notation for escape sequences is MM-- followed by a character.  For
  1052.     example, MM--ff (pronounced Meta f) is entered by depressing <Esc> (ASCII
  1053.     003333) followed by `f'.  (MM--FF would be the notation for <Esc> followed by
  1054.     <Shift> (capital) `F'.)
  1055.  
  1056.     All edit commands operate from any place on the line (not just at the
  1057.     beginning).  Neither the <Return> nor the <Line Feed> key is entered
  1058.     after edit commands except when noted.
  1059.  
  1060.     ^^FF        Move cursor forward (right) one character.
  1061.  
  1062.     MM--ff       Move cursor forward one word.  (The emacs editor's idea of a
  1063.               word is a string of characters consisting of only letters,
  1064.               digits and underscores.)
  1065.  
  1066.     ^^BB        Move cursor backward (left) one character.
  1067.  
  1068.     MM--bb       Move cursor backward one word.
  1069.  
  1070.     ^^AA        Move cursor to start of line.
  1071.  
  1072.     ^^EE        Move cursor to end of line.
  1073.  
  1074.     ^^]]_cc_hh_aa_rr    Move cursor forward to character _cc_hh_aa_rr on current line.
  1075.  
  1076.     MM--^^]]_cc_hh_aa_rr  Move cursor back to character _cc_hh_aa_rr on current line.
  1077.  
  1078.     ^^XX^^XX      Interchange the cursor and mark.
  1079.  
  1080.     eerraassee     (User defined erase character as defined by the ssttttyy(C) com-
  1081.               mand, usually ^^HH or ##.)  Delete previous character.
  1082.  
  1083.     ^^DD        Delete current character.
  1084.  
  1085.     MM--dd       Delete current word.
  1086.  
  1087.     MM--^^HH      (Meta-backspace) Delete previous word.
  1088.  
  1089.     MM--hh       Delete previous word.
  1090.  
  1091.     MM--^^??      (Meta-DEL) Delete previous word (if your interrupt character is
  1092.               ^^?? (DEL, the default) then this command will not work).
  1093.  
  1094.     ^^TT        Transpose current character with next character in eemmaaccss mode.
  1095.               Transpose two previous characters in ggmmaaccss mode.
  1096.  
  1097.     ^^CC        Capitalize current character.
  1098.  
  1099.     MM--cc       Capitalize current word.
  1100.  
  1101.     MM--ll       Change the current word to lower case.
  1102.  
  1103.     ^^KK        Delete from the cursor to the end of the line.  If preceded by
  1104.               a numerical parameter whose value is less than the current cur-
  1105.               sor position, then delete from given position up to the cursor.
  1106.               If preceded by a numerical parameter whose value is greater
  1107.               than the current cursor position, then delete from cursor up to
  1108.               given cursor position.
  1109.  
  1110.     ^^WW        Kill from the cursor to the mark.
  1111.  
  1112.     MM--pp       Push the region from the cursor to the mark on the stack.
  1113.  
  1114.     kkiillll      (User defined kill character as defined by the ssttttyy command,
  1115.               usually ^^UU or @@.)  Kill the entire current line.  If two kkiillll
  1116.               characters are entered in succession, all kill characters from
  1117.               then on cause a line feed (useful when using paper terminals).
  1118.  
  1119.     ^^YY        Restore last item removed from line. (Yank item back to the
  1120.               line.)
  1121.  
  1122.     ^^LL        Line feed and print current line.
  1123.  
  1124.     ^^@@        (Null character) Set mark.
  1125.  
  1126.     MM--_ss_pp_aa_cc_ee   (Meta space) Set mark.
  1127.  
  1128.     ^^JJ        (New line) Execute the current line.
  1129.  
  1130.     ^^MM        (Return) Execute the current line.
  1131.  
  1132.     eeooff       End-of-file character, normally ^^DD, is processed as an End-of-
  1133.               file only if the current line is null.
  1134.  
  1135.     ^^PP        Fetch previous command.  Each time ^^PP is entered the previous
  1136.               command back in time is accessed.  Moves back one line when not
  1137.               on the first line of a multi-line command.
  1138.  
  1139.     MM--<<       Fetch the least recent (oldest) history line.
  1140.  
  1141.     MM-->>       Fetch the most recent (youngest) history line.
  1142.  
  1143.     ^^NN        Fetch next command line.  Each time ^^NN is entered the next com-
  1144.               mand line forward in time is accessed.
  1145.  
  1146.     ^^RR_ss_tt_rr_ii_nn_gg  Reverse search history for a previous command line containing
  1147.               _ss_tt_rr_ii_nn_gg.  If a parameter of zero is given, the search is for-
  1148.               ward.  _ss_tt_rr_ii_nn_gg is terminated by a RREETTUURRNN or NNEEWW LLIINNEE.  If _ss_tt_rr_ii_nn_gg
  1149.               is preceded by a ``^'', the matched line must begin with
  1150.               _ss_tt_rr_ii_nn_gg.  If _ss_tt_rr_ii_nn_gg is omitted, then the next command line con-
  1151.               taining the most recent _ss_tt_rr_ii_nn_gg is accessed.  In this case a
  1152.               parameter of zero reverses the direction of the search.
  1153.  
  1154.     ^^OO        Operate - Execute the current line and fetch the next line
  1155.               relative to current line from the history file.
  1156.  
  1157.     MM--_dd_ii_gg_ii_tt_ss  (Escape) Define numeric parameter, the digits are taken as a
  1158.               parameter to the next command.  The commands that accept a
  1159.               parameter are ^^FF, ^^BB, eerraassee, ^^CC, ^^DD, ^^KK, ^^RR, ^^PP, ^^NN, ^^]], MM--..,
  1160.               MM--^^]], MM--__, MM--bb, MM--cc, MM--dd, MM--ff, MM--hh, MM--ll and MM--^^HH.
  1161.  
  1162.     MM--_ll_ee_tt_tt_ee_rr  Soft-key - Your alias list is searched for an alias by the name
  1163.               ___ll_ee_tt_tt_ee_rr and if an alias of this name is defined, its value will
  1164.               be inserted on the input queue.  The _ll_ee_tt_tt_ee_rr must not be one of
  1165.               the above meta-functions.
  1166.  
  1167.     MM--]]_ll_ee_tt_tt_ee_rr Soft-key - Your alias list is searched for an alias by the name
  1168.               _____ll_ee_tt_tt_ee_rr (two underscores precede _ll_ee_tt_tt_ee_rr) and if an alias of
  1169.               this name is defined, its value will be inserted on the input
  1170.               queue.  This can be used to program function keys on many ter-
  1171.               minals.
  1172.  
  1173.     MM--..       The last word of the previous command is inserted on the line.
  1174.               If preceded by a numeric parameter, the value of this parameter
  1175.               determines which word to insert rather than the last word.
  1176.  
  1177.     MM--__       Same as MM--...
  1178.  
  1179.     MM--**       Attempt file name generation on the current word.  An asterisk
  1180.               is appended if the word doesn't match any file or contain any
  1181.               special pattern characters.
  1182.  
  1183.     MM--EESSCC     File name completion.  The current word is treated as a root to
  1184.               which an asterisk is appended. A search is conducted for files
  1185.               matching the current word.  The first match found then replaces
  1186.               the current word.  Subsequent matches are obtained by repeating
  1187.               the MM--EESSCC keystroke.  If the match is both unique and a direc-
  1188.               tory, a ``/'' is appended to it.  If it is unique but not a
  1189.               directory, a space is appended to it.
  1190.  
  1191.     MM--==       List files matching current word pattern if an asterisk were
  1192.               appended.
  1193.  
  1194.     ^^UU        Multiply parameter of next command by 4.
  1195.  
  1196.     \\         Escape next character.  Editing characters, the user's eerraassee,
  1197.               kkiillll and iinntteerrrruupptt (normally ^^??) characters may be entered in a
  1198.               command line or in a search string if preceded by a ``\''.  The
  1199.               ``\'' removes the next character's editing features (if any).
  1200.  
  1201.     ^^VV        Display version of the shell.
  1202.  
  1203.     MM--##       Insert a ``#'' at the beginning of the line and execute it.
  1204.               This causes a comment to be inserted in the history file.
  1205.  
  1206.     _V_i _e_d_i_t_i_n_g _m_o_d_e
  1207.  
  1208.     There are two typing modes.  Initially, when you enter a command you are
  1209.     in the iinnppuutt mode.  To edit, the user enters ccoonnttrrooll mode by typing <Esc>
  1210.     (ASCII 033) and moves the cursor to the point needing correction and then
  1211.     inserts or deletes characters or words as needed.  Most control commands
  1212.     accept an optional repeat count prior to the command.
  1213.  
  1214.     When in vvii mode on most systems, canonical processing is initially
  1215.     enabled and the command will be echoed again if the speed is 1200 baud or
  1216.     greater and it contains any control characters or less than one second
  1217.     has elapsed since the prompt was printed.  The <Esc> character terminates
  1218.     canonical processing for the remainder of the command and the user can
  1219.     then modify the command line.  This scheme has the advantages of canoni-
  1220.     cal processing with the type-ahead echoing of raw mode.
  1221.  
  1222.     If the option vviirraaww is also set, the terminal will always have canonical
  1223.     processing disabled.  This may be helpful for certain terminals.
  1224.  
  1225.     _I_n_p_u_t _e_d_i_t _c_o_m_m_a_n_d_s
  1226.  
  1227.     By default the editor is in input mode.
  1228.  
  1229.     eerraassee     (User defined erase character as defined by the ssttttyy command,
  1230.               usually ^^HH or ##.)  Delete previous character.
  1231.  
  1232.     ^^WW        Delete the previous blank separated word.
  1233.  
  1234.     ^^DD        Terminate the shell.
  1235.  
  1236.     ^^VV        Escape next character.  Editing characters, the user's erase or
  1237.               kill characters may be entered in a command line or in a search
  1238.               string if preceded by a ^^VV.  The ^^VV removes the next
  1239.               character's editing features (if any).
  1240.  
  1241.     \\         Escape the next eerraassee or kkiillll character.
  1242.  
  1243.     _M_o_t_i_o_n _e_d_i_t _c_o_m_m_a_n_d_s
  1244.  
  1245.     These commands will move the cursor.
  1246.  
  1247.     [_cc_oo_uu_nn_tt]ll  Cursor forward (right) one character.
  1248.  
  1249.     [_cc_oo_uu_nn_tt]ww  Cursor forward one alpha-numeric word.
  1250.  
  1251.     [_cc_oo_uu_nn_tt]WW  Cursor to the beginning of the next word that follows a blank.
  1252.  
  1253.     [_cc_oo_uu_nn_tt]ee  Cursor to end of word.
  1254.  
  1255.     [_cc_oo_uu_nn_tt]EE  Cursor to end of the current blank delimited word.
  1256.  
  1257.     [_cc_oo_uu_nn_tt]hh  Cursor backward (left) one character.
  1258.     [_cc_oo_uu_nn_tt]bb  Cursor backward one word.
  1259.  
  1260.     [_cc_oo_uu_nn_tt]BB  Cursor to preceding blank separated word.
  1261.  
  1262.     [_cc_oo_uu_nn_tt]||  Cursor to column _cc_oo_uu_nn_tt.
  1263.  
  1264.     [_cc_oo_uu_nn_tt]ff_cc Find the next character _cc in the current line.
  1265.  
  1266.     [_cc_oo_uu_nn_tt]FF_cc Find the previous character _cc in the current line.
  1267.  
  1268.     [_cc_oo_uu_nn_tt]tt_cc Equivalent to ff followed by hh.
  1269.  
  1270.     [_cc_oo_uu_nn_tt]TT_cc Equivalent to FF followed by ll.
  1271.  
  1272.     [_cc_oo_uu_nn_tt];;  Repeats _cc_oo_uu_nn_tt times, the last single character find command, ff,
  1273.               FF, tt, or TT.
  1274.  
  1275.     [_cc_oo_uu_nn_tt],,  Reverses the last single character find command _cc_oo_uu_nn_tt times.
  1276.  
  1277.     00         Cursor to start of line.
  1278.  
  1279.     ^^         Cursor to first non-blank character in line.
  1280.  
  1281.     $$         Cursor to end of line.
  1282.  
  1283.     _S_e_a_r_c_h _e_d_i_t _c_o_m_m_a_n_d_s
  1284.  
  1285.     These commands access your command history.
  1286.  
  1287.     [_cc_oo_uu_nn_tt]kk  Fetch previous command.  Each time kk is entered the previous
  1288.               command back in time is accessed.
  1289.  
  1290.     [_cc_oo_uu_nn_tt]--  Equivalent to kk.
  1291.  
  1292.     [_cc_oo_uu_nn_tt]jj  Fetch next command.  Each time jj is entered the next command
  1293.               forward in time is accessed.
  1294.  
  1295.     [_cc_oo_uu_nn_tt]++  Equivalent to jj.
  1296.  
  1297.     [_cc_oo_uu_nn_tt]GG  The command number _cc_oo_uu_nn_tt is fetched.  The default is the least
  1298.               recent history command.
  1299.  
  1300.     //_ss_tt_rr_ii_nn_gg   Search backward through history for a previous command contain-
  1301.               ing _ss_tt_rr_ii_nn_gg.  _ss_tt_rr_ii_nn_gg is terminated by a RREETTUURRNN or NNEEWW LLIINNEE.  If
  1302.               _ss_tt_rr_ii_nn_gg is preceded by a ``^'', the matched line must begin with
  1303.               _ss_tt_rr_ii_nn_gg.  If _ss_tt_rr_ii_nn_gg is null the previous string will be used.
  1304.  
  1305.     ??_ss_tt_rr_ii_nn_gg   Same as ``/'' except that search will be in the forward direc-
  1306.               tion.
  1307.  
  1308.     nn         Search for next match of the last pattern to ``/'' or ``?''
  1309.               commands.
  1310.  
  1311.     NN         Search for next match of the last pattern to ``/'' or ``?'',
  1312.               but in reverse direction.  Search history for the _ss_tt_rr_ii_nn_gg
  1313.               entered by the previous ``/'' command.
  1314.  
  1315.     _T_e_x_t _m_o_d_i_f_i_c_a_t_i_o_n _e_d_i_t _c_o_m_m_a_n_d_s
  1316.  
  1317.     These commands will modify the line.
  1318.  
  1319.     aa         Enter input mode and enter text after the current character.
  1320.  
  1321.     AA         Append text to the end of the line.  Equivalent to $$aa.
  1322.  
  1323.     [_cc_oo_uu_nn_tt]cc_mm_oo_tt_ii_oo_nn
  1324.     cc[_cc_oo_uu_nn_tt]_mm_oo_tt_ii_oo_nn
  1325.               Delete current character through the character that _mm_oo_tt_ii_oo_nn
  1326.               would move the cursor to and enter input mode.  If _mm_oo_tt_ii_oo_nn is
  1327.               ``c'', the entire line will be deleted and input mode entered.
  1328.  
  1329.     CC         Delete the current character through the end of line and enter
  1330.               input mode.  Equivalent to cc$$.
  1331.  
  1332.     SS         Equivalent to cccc.
  1333.  
  1334.     DD         Delete the current character through the end of line.
  1335.               Equivalent to dd$$.
  1336.  
  1337.     [_cc_oo_uu_nn_tt]dd_mm_oo_tt_ii_oo_nn
  1338.     dd[_cc_oo_uu_nn_tt]_mm_oo_tt_ii_oo_nn
  1339.               Delete current character through the character that _mm_oo_tt_ii_oo_nn
  1340.               would move to.  If _mm_oo_tt_ii_oo_nn is ``d'', the entire line will be
  1341.               deleted.
  1342.  
  1343.     ii         Enter input mode and insert text before the current character.
  1344.  
  1345.     II         Insert text before the beginning of the line.  Equivalent to
  1346.               00ii.
  1347.  
  1348.     [_cc_oo_uu_nn_tt]PP  Place the previous text modification before the cursor.
  1349.  
  1350.     [_cc_oo_uu_nn_tt]pp  Place the previous text modification after the cursor.
  1351.  
  1352.     RR         Enter input mode and replace characters on the screen with
  1353.               characters you type overlay fashion.
  1354.  
  1355.     [_cc_oo_uu_nn_tt]rr_cc Replace the _cc_oo_uu_nn_tt character(s) starting at the current cursor
  1356.               position with _cc, and advance the cursor.
  1357.  
  1358.     [_cc_oo_uu_nn_tt]xx  Delete current character.
  1359.  
  1360.     [_cc_oo_uu_nn_tt]XX  Delete preceding character.
  1361.  
  1362.     [_cc_oo_uu_nn_tt]..  Repeat the previous text modification command.
  1363.  
  1364.     [_cc_oo_uu_nn_tt]~~  Invert the case of the _cc_oo_uu_nn_tt character(s) starting at the
  1365.               current cursor position and advance the cursor.
  1366.  
  1367.     [_cc_oo_uu_nn_tt]__  Causes the _cc_oo_uu_nn_tt word of the previous command to be appended
  1368.               and input mode entered.  The last word is used if _cc_oo_uu_nn_tt is
  1369.               omitted.
  1370.  
  1371.     **         Causes a ``*'' to be appended to the current word and file name
  1372.               generation attempted.  If no match is found, it rings the bell.
  1373.               Otherwise, the word is replaced by the matching pattern and
  1374.               input mode is entered.
  1375.  
  1376.     \\         Filename completion.  Replaces the current word with the long-
  1377.               est common prefix of all filenames matching the current word
  1378.               with an asterisk appended.  If the match is unique, a ``/'' is
  1379.               appended if the file is a directory and a space is appended if
  1380.               the file is not a directory.
  1381.  
  1382.     _O_t_h_e_r _e_d_i_t _c_o_m_m_a_n_d_s
  1383.  
  1384.     MMiisscceellllaanneeoouuss ccoommmmaannddss.
  1385.  
  1386.     [_cc_oo_uu_nn_tt]yy_mm_oo_tt_ii_oo_nn
  1387.     yy[_cc_oo_uu_nn_tt]_mm_oo_tt_ii_oo_nn
  1388.               Yank current character through character that _mm_oo_tt_ii_oo_nn would move
  1389.               the cursor to and puts them into the delete buffer.  The text
  1390.               and cursor are unchanged.
  1391.  
  1392.     YY         Yanks from current position to end of line.  Equivalent to yy$$.
  1393.  
  1394.     uu         Undo the last text modifying command.
  1395.  
  1396.     UU         Undo all the text modifying commands performed on the line.
  1397.  
  1398.     [_cc_oo_uu_nn_tt]vv  Returns the command ffcc --ee $${{VVIISSUUAALL::--$${{EEDDIITTOORR::--vvii}}}} _cc_oo_uu_nn_tt in the
  1399.               input buffer.  If _cc_oo_uu_nn_tt is omitted, then the current line is
  1400.               used.
  1401.  
  1402.     ^^LL        Line feed and print current line.  Has effect only in control
  1403.               mode.
  1404.  
  1405.     ^^JJ        (New line) Execute the current line, regardless of mode.
  1406.  
  1407.     ^^MM        (Return) Execute the current line, regardless of mode.
  1408.  
  1409.     ##         Sends the line after inserting a ``#'' in front of the line.
  1410.               Useful for causing the current line to be inserted in the his-
  1411.               tory without being executed.
  1412.  
  1413.     ==         List the file names that match the current word if an asterisk
  1414.               were appended to it.
  1415.  
  1416.     @@_ll_ee_tt_tt_ee_rr   Your alias list is searched for an alias by the name ___ll_ee_tt_tt_ee_rr
  1417.               and if an alias of this name is defined, its value will be
  1418.               inserted on the input queue for processing.
  1419.  
  1420.     _S_p_e_c_i_a_l _c_o_m_m_a_n_d_s
  1421.  
  1422.     The following simple-commands are executed in the shell process.
  1423.     Input/output redirection is permitted.  Unless otherwise indicated, the
  1424.     output is written on file descriptor 1 and the exit status, when there is
  1425.     no syntax error, is zero.  Commands that are preceded by {1} or {2} are
  1426.     treated specially in the following ways:
  1427.  
  1428.     1.  Parameter assignment lists preceding the command remain in effect
  1429.         when the command completes.
  1430.  
  1431.     2.  I/O redirections are processed after parameter assignments.
  1432.  
  1433.     3.  Errors cause a script that contains them to abort.
  1434.  
  1435.     4.  Words, following a command preceded by {2} that are in the format of
  1436.         a parameter assignment, are expanded with the same rules as a parame-
  1437.         ter assignment.  This means that tilde substitution is performed
  1438.         after the ``='' sign and word splitting and file name generation are
  1439.         not performed.
  1440.  
  1441.     {1} :: [ _aa_rr_gg ... ]
  1442.          The command only expands parameters.
  1443.  
  1444.     {1} .. _ff_ii_ll_ee [ _aa_rr_gg ... ]
  1445.          Read the complete file then execute the commands.  The syntax for
  1446.          this is dot-space-file followed by optional arguments.  The commands
  1447.          are executed in the current shell environment.  The search path
  1448.          specified by PPAATTHH is used to find the directory containing _ff_ii_ll_ee.  If
  1449.          any arguments _aa_rr_gg are given, they become the positional parameters.
  1450.          Otherwise the positional parameters are unchanged.  The exit status
  1451.          is the exit status of the last command executed.
  1452.  
  1453.     {2} aalliiaass [ --ttxx ] [ _nn_aa_mm_ee [ == _vv_aa_ll_uu_ee ] ] ...
  1454.          aalliiaass with no arguments prints the list of aliases in the form
  1455.          _nn_aa_mm_ee_==_vv_aa_ll_uu_ee on standard output.  An alias is defined for each name
  1456.          whose value is given.  A trailing space in value causes the next
  1457.          word to be checked for alias substitution.  The --tt flag is used to
  1458.          set and list tracked aliases.  The value of a tracked alias is the
  1459.          full pathname corresponding to the given name.  The value becomes
  1460.          undefined when the value of PPAATTHH is reset but the aliases remained
  1461.          tracked.  Without the --tt flag, for each name in the argument list
  1462.          for which no value is given, the name and value of the alias is
  1463.          printed.  The --xx flag is used to set or print exported aliases.  An
  1464.          exported alias is defined for scripts invoked by name.  The exit
  1465.          status is non-zero if a name is given, but no value, for which no
  1466.          alias has been defined.
  1467.  
  1468.     bbgg [ _jj_oo_bb ... ]
  1469.          This command is only on systems that support job control.  Puts each
  1470.          specified job into the background.  The current job is put in the
  1471.          background if job is not specified.  See ``Jobs'' for a description
  1472.          of the format of job.
  1473.  
  1474.     {1} bbrreeaakk [ _nn ]
  1475.          Exit from the enclosing ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop, if any.
  1476.          If _nn is specified then break _nn levels.
  1477.  
  1478.     {1} ccoonnttiinnuuee [ _nn ]
  1479.          Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or
  1480.          sseelleecctt loop.  If _nn is specified then resume at the _nn-th enclosing
  1481.          loop.
  1482.  
  1483.     ccdd [ --LLPP ] [ _aa_rr_gg ]
  1484.     ccdd [ --LLPP ] _oo_ll_dd _nn_ee_ww
  1485.          This command can be in either of two forms.  In the first form it
  1486.          changes the current directory to _aa_rr_gg.  If _aa_rr_gg is ``-'' the directory
  1487.          is changed to the previous directory.  If no _aa_rr_gg is specified, the
  1488.          shell parameter HHOOMMEE is used as a default _aa_rr_gg.  The parameter PPWWDD is
  1489.          set to the current directory.  The shell parameter CCDDPPAATTHH defines
  1490.          the search path for the directory containing _aa_rr_gg.  Alternative
  1491.          directory names are separated by a colon (::).  The default path is
  1492.          <<nnuullll>> (specifying the current directory).  Note that the current
  1493.          directory is specified by a null path name, which can appear immedi-
  1494.          ately after the equal sign or between the colon delimiters anywhere
  1495.          else in the path list.  If _aa_rr_gg begins with a ``/'' then the search
  1496.          path is not used.  Otherwise, each directory in the path is searched
  1497.          for _aa_rr_gg.
  1498.  
  1499.          The second form of ccdd substitutes the string _nn_ee_ww for the string _oo_ll_dd
  1500.          in the current directory name, PPWWDD, and tries to change to this new
  1501.          directory.
  1502.  
  1503.          The --LL and --PP flags are relevant to systems with symbolic links.
  1504.          The default, --LL, preserves logical naming, so that ccdd --LL .... will
  1505.          move up one component towards the root.  The physical option, --PP,
  1506.          uses a physical model for paths.  Thus, if /_u_s_r/_i_n_c_l_u_d_e/_s_y_s is a
  1507.          symbolic link to the directory /_s_y_s/_h, then after ccdd
  1508.          //uussrr//iinncclluuddee//ssyyss, a ccdd ....  would make the current directory
  1509.          /_u_s_r/_i_n_c_l_u_d_e, while a ccdd --PP .... would make it _s_y_s.
  1510.  
  1511.          The ccdd command may not be executed by rrkksshh.
  1512.  
  1513.     eecchhoo [ _aa_rr_gg ... ]
  1514.          See eecchhoo(C) for usage and description.
  1515.  
  1516.     {1} eevvaall [ _aa_rr_gg ... ]
  1517.          The arguments are read as input to the shell and the resulting
  1518.          command(s) executed.
  1519.  
  1520.     {1} eexxeecc [ _aa_rr_gg ... ]
  1521.          If _aa_rr_gg is given, the command specified by the arguments is executed
  1522.          in place of this shell without creating a new process.  Input/output
  1523.          arguments may appear and affect the current process.  If no argu-
  1524.          ments are given the effect of this command is to modify file
  1525.          descriptors as prescribed by the input/output redirection list.  In
  1526.          this case, any file descriptor numbers greater than 2 that are
  1527.          opened with this mechanism are closed when invoking another program.
  1528.  
  1529.     {1} eexxiitt [ _nn ]
  1530.          Causes the shell to exit with the exit status specified by _nn.  If _nn
  1531.          is omitted then the exit status is that of the last command exe-
  1532.          cuted.  An end-of-file will also cause the shell to exit except for
  1533.          a shell which has the iiggnnoorreeeeooff option (see ``set'' below) turned
  1534.          on.
  1535.  
  1536.     {2} eexxppoorrtt [ _nn_aa_mm_ee [ == _vv_aa_ll_uu_ee ] ] ...
  1537.          The given names are marked for automatic export to the environment
  1538.          of subsequently-executed commands.
  1539.  
  1540.     ffcc [ --ee _ee_nn_aa_mm_ee  ] [ --nnllrr ] [ _ff_ii_rr_ss_tt [ _ll_aa_ss_tt ] ]
  1541.     ffcc --ee -- [ _oo_ll_dd==_nn_ee_ww ] [ _cc_oo_mm_mm_aa_nn_dd ]
  1542.          In the first form, a range of commands from _ff_ii_rr_ss_tt to _ll_aa_ss_tt is
  1543.          selected from the last HHIISSTTSSIIZZEE commands that were typed at the ter-
  1544.          minal.  The arguments first and last may be specified as a number or
  1545.          as a string.  A string is used to locate the most recent command
  1546.          that starts with that string.  A negative number is used as an
  1547.          offset to the current command number.  If the flag --ll, is selected,
  1548.          the commands are listed on standard output.  Otherwise, the editor
  1549.          program _ee_nn_aa_mm_ee is invoked on a file containing these keyboard com-
  1550.          mands.  If _ee_nn_aa_mm_ee is not supplied, then the value of the parameter
  1551.          FFCCEEDDIITT (default /bin/ed) is used as the editor.  When editing is
  1552.          complete, the edited command(s) is executed.  If _ll_aa_ss_tt is not speci-
  1553.          fied then it will be set to _ff_ii_rr_ss_tt.  If _ff_ii_rr_ss_tt is not specified the
  1554.          default is the previous command for editing and --1166 for listing.
  1555.  
  1556.          The flag --rr reverses the order of the commands and the flag --nn
  1557.          suppresses command numbers when listing.  In the second form the
  1558.          command is re-executed after the substitution _oo_ll_dd==_nn_ee_ww is performed.
  1559.  
  1560.     ffgg [ _jj_oo_bb... ]
  1561.          This command is only on systems that support job control.  Each job
  1562.          specified is brought to the foreground.  Otherwise, the current job
  1563.          is brought into the foreground.  See ``Jobs'' for a description of
  1564.          the format of _jj_oo_bb.
  1565.  
  1566.     ggeettooppttss _oo_pp_tt_ss_tt_rr_ii_nn_gg _nn_aa_mm_ee [ _aa_rr_gg ... ]
  1567.          Checks _aa_rr_gg for legal options.  If _aa_rr_gg is omitted, the positional pa-
  1568.          rameters are used.  An option argument begins with a ``+'' or a
  1569.          ``-''.  An option not beginning with ``+'' or ``-'' or the special
  1570.          argument ``--'' ends the options.  _oo_pp_tt_ss_tt_rr_ii_nn_gg contains the letters
  1571.          that ggeettooppttss recognizes.  If a letter is followed by a ``:'', that
  1572.          option is expected to have an argument.  The options can be
  1573.          separated from the argument by blanks.
  1574.  
  1575.          ggeettooppttss places the next option letter it finds inside variable _nn_aa_mm_ee
  1576.          each time it is invoked with a ``+'' prepended when _aa_rr_gg begins with
  1577.          a ``+''.  The index of the next _aa_rr_gg is stored in OOPPTTIINNDD.  The option
  1578.          argument, if any, gets stored in OOPPTTAARRGG.
  1579.  
  1580.          A leading ``:'' in _oo_pp_tt_ss_tt_rr_ii_nn_gg causes ggeettooppttss to store the letter of
  1581.          an invalid option in OOPPTTAARRGG, and to set _nn_aa_mm_ee to ``?'' for an unknown
  1582.          option and to ``:'' when a required option is missing.  Otherwise,
  1583.          ggeettooppttss prints an error message.  The exit status is non-zero when
  1584.          there are no more options.
  1585.  
  1586.     jjoobbss [ --llnnpp ] [ _jj_oo_bb ... ]
  1587.          Lists information about each given job, or all active jobs if _jj_oo_bb is
  1588.          omitted.  The --ll flag lists process ids in addition to the normal
  1589.          information.  The --nn flag only displays jobs that have stopped or
  1590.          exited since last notified.  The --pp flag causes only the process
  1591.          group to be listed.  See ``Jobs'' for a description of the format of
  1592.          _jj_oo_bb.
  1593.  
  1594.     kkiillll [ --_ss_ii_gg ] _jj_oo_bb ...
  1595.     kkiillll --ll
  1596.          Sends either the TTEERRMM (terminate) signal or the specified signal to
  1597.          the specified jobs or processes.  Signals are either given by number
  1598.          or by names (as given in /_u_s_r/_i_n_c_l_u_d_e/_s_i_g_n_a_l._h, stripped of the pre-
  1599.          fix ``SIG'').  If the signal being sent is TTEERRMM (terminate) or HHUUPP
  1600.          (hangup), then the job or process will be sent a CCOONNTT (continue)
  1601.          signal if it is stopped.  The argument _jj_oo_bb can specify the process
  1602.          id of a process that is not a member of one of the active jobs.  See
  1603.          ``Jobs'' for a description of the format of _jj_oo_bb.  In the second
  1604.          form, kkiillll --ll, the signal numbers and names are listed.
  1605.  
  1606.     lleett _aa_rr_gg ...
  1607.          Each _aa_rr_gg is a separate arithmetic expression to be evaluated.  See
  1608.          ``Arithmetic evaluation'' above, for a description of arithmetic
  1609.          expression evaluation.
  1610.  
  1611.          The exit status is 0 if the value of the last expression is non-
  1612.          zero, and 1 otherwise.
  1613.  
  1614.     {1} nneewwggrrpp [ _aa_rr_gg ... ]
  1615.          Equivalent to eexxeecc //bbiinn//nneewwggrrpp _aa_rr_gg ....
  1616.  
  1617.     pprriinntt [ --RRnnpprrssuu[_nn ] ] [ _aa_rr_gg ... ]
  1618.          The shell output mechanism.  With no flags or with flag ``-'' or
  1619.          ``--'' the arguments are printed on standard output as described by
  1620.          eecchhoo(C).  In raw mode, --RR or --rr, the escape conventions of eecchhoo are
  1621.          ignored.  The --RR option will print all subsequent arguments and
  1622.          options other than --nn.  The --pp option causes the arguments to be
  1623.          written onto the pipe of the process spawned with ||&& instead of
  1624.          standard output.  The --ss option causes the arguments to be written
  1625.          onto the history file instead of standard output.  The --uu flag can
  1626.          be used to specify a one-digit file descriptor unit number _nn on
  1627.          which the output will be placed.  The default is 1.  If the flag --nn
  1628.          is used, no new-line is added to the output.
  1629.  
  1630.     ppwwdd [ --LLPP ]
  1631.          Equivalent to pprriinntt --rr -- $$PPWWDD
  1632.  
  1633.          The --LL and --PP flags are relevant only on systems with symbolic
  1634.          links.  The default, --LL, uses a logical model, while --PP uses a phy-
  1635.          sical model, for paths.  Thus, if /_u_s_r/_i_n_c_l_u_d_e/_s_y_s is a symbolic
  1636.          link to the directory /_s_y_s/_h, then ccdd//uussrr//iinncclluuddee//ssyyss;;ppwwdd;;ppwwdd--PP will
  1637.          print /_u_s_r/_i_n_c_l_u_d_e/_s_y_s, followed by /_s_y_s/_h.
  1638.  
  1639.     rreeaadd [ --pprrssuu[ _nn ] ] [ _nn_aa_mm_ee??_pp_rr_oo_mm_pp_tt ] [ _nn_aa_mm_ee ... ]
  1640.          The shell input mechanism.  One line is read and is broken up into
  1641.          fields using the characters in IIFFSS as separators.  In raw mode, --rr,,
  1642.          a ``\'' at the end of a line does not signify line continuation.
  1643.          The first field is assigned to the first _nn_aa_mm_ee, the second field to
  1644.          the second _nn_aa_mm_ee, etc., with leftover fields assigned to the last
  1645.          _nn_aa_mm_ee.  The --pp option causes the input line to be taken from the
  1646.          input pipe of a process spawned by the shell using ||&&.  If the --ss
  1647.          flag is present, the input will be saved as a command in the history
  1648.          file.  The flag --uu can be used to specify a one digit file descrip-
  1649.          tor unit to read from.  The file descriptor can be opened with the
  1650.          eexxeecc special command.  The default value of _nn is 0.  If _nn_aa_mm_ee is
  1651.          omitted then RREEPPLLYY is used as the default name.  The exit status is
  1652.          0 unless an end-of-file is encountered.  An end-of-file with the --pp
  1653.          option causes cleanup for this process so that another can be
  1654.          spawned.  If the first argument contains a ``?'', the remainder of
  1655.          this word is used as a prompt on standard error when the shell is
  1656.          interactive.  The exit status is 0 unless an end-of-file is encoun-
  1657.          tered.
  1658.  
  1659.     {2} rreeaaddoonnllyy [ _nn_aa_mm_ee [ == _vv_aa_ll_uu_ee ] ] ...
  1660.          The given names are marked readonly and these names cannot be
  1661.          changed by subsequent assignment.
  1662.  
  1663.     {1} rreettuurrnn [ _nn ]
  1664.          Causes a shell function to return to the invoking script with the
  1665.          return status specified by _nn.  If _nn is omitted then the return
  1666.          status is that of the last command executed.  If rreettuurrnn is invoked
  1667.          while not in a function or a ``.''  script, then it is the same as
  1668.          an eexxiitt.
  1669.  
  1670.     set [ +-aefhkmnopstuvx ] [ +-o option ]... [ +-A name ] [ arg ... ]
  1671.          The flags for this command have meaning as follows:
  1672.  
  1673.          --AA      Array assignment.  Unset the variable _nn_aa_mm_ee and assign values
  1674.                  sequentially from the list _aa_rr_gg.  If ++AA is used, the variable
  1675.                  _nn_aa_mm_ee is not unset first.
  1676.  
  1677.          --aa      All subsequent parameters that are defined are automatically
  1678.                  exported.
  1679.  
  1680.          --ee      If a command has a non-zero exit status, execute the EERRRR
  1681.                  trap, if set, and exit.  This mode is disabled while reading
  1682.                  profiles.
  1683.  
  1684.          --ff      Disables file name generation.
  1685.  
  1686.          --hh      Each command becomes a tracked alias when first encountered.
  1687.  
  1688.          --kk      All parameter assignment arguments are placed in the
  1689.                  environment for a command, not just those that precede the
  1690.                  command name.
  1691.  
  1692.          --mm      Background jobs will run in a separate process group and a
  1693.                  line will print upon completion.  The exit status of back-
  1694.                  ground jobs is reported in a completion message.  On systems
  1695.                  with job control, this flag is turned on automatically for
  1696.                  interactive shells.
  1697.  
  1698.          --nn      Read commands and check them for syntax errors, but do not
  1699.                  execute them.  Ignored for interactive shells.
  1700.  
  1701.          --oo      List all option settings.
  1702.  
  1703.                  The argument following --oo can be one of the following _oo_pp_tt_ii_oo_nn
  1704.                  names:
  1705.  
  1706.                  aalllleexxppoorrtt Same as --aa.
  1707.  
  1708.                  eerrrreexxiitt   Same as --ee.
  1709.  
  1710.                  bbggnniiccee    All background jobs are run at a lower priority.
  1711.                            This is the default mode.
  1712.  
  1713.                  eemmaaccss     Puts you in an eemmaaccss style in-line editor for com-
  1714.                            mand entry.
  1715.  
  1716.                  ggmmaaccss     Puts you in a ggmmaaccss style in-line editor for com-
  1717.                            mand entry.
  1718.  
  1719.                  iiggnnoorreeeeooff The shell will not exit on end-of-file.  The com-
  1720.                            mand eexxiitt must be used.
  1721.  
  1722.                  kkeeyywwoorrdd   Same as --kk.
  1723.  
  1724.                  mmaarrkkddiirrss  All directory names resulting from file name gen-
  1725.                            eration have a trailing ``/'' appended.
  1726.  
  1727.                  mmoonniittoorr   Same as --mm.
  1728.  
  1729.                  nnoocclloobbbbeerr Prevents output redirection (>) from truncating
  1730.                            existing files.  Require >>|| to truncate a file
  1731.                            when turned on.
  1732.  
  1733.                  nnooeexxeecc    Same as --nn.
  1734.  
  1735.                  nnoogglloobb    Same as --ff.
  1736.  
  1737.                  nnoolloogg     Do not save function definitions in history file.
  1738.  
  1739.                  nnoouunnsseett   Same as --uu.
  1740.  
  1741.                  pprriivviilleeggeedd
  1742.                            Same as --pp.
  1743.  
  1744.                  ttrraacckkaallll  Same as --hh.
  1745.  
  1746.                  vveerrbboossee   Same as --vv.
  1747.  
  1748.                  vvii        Puts you in insert mode of a vvii style in-line edi-
  1749.                            tor until you hit escape character 003333.  This puts
  1750.                            you in move mode.  A return sends the line.
  1751.  
  1752.                  vviirraaww     Each character is processed as it is typed in vvii
  1753.                            mode.
  1754.  
  1755.                  xxttrraaccee    Same as --xx.
  1756.  
  1757.                  If no _oo_pp_tt_ii_oo_nn name is supplied then the current option set-
  1758.                  tings are printed.
  1759.  
  1760.          --pp      Disables processing of the $$HHOOMMEE/._p_r_o_f_i_l_e file and uses the
  1761.                  file /_e_t_c/_s_u_i_d__p_r_o_f_i_l_e instead of the EENNVV file.  This mode
  1762.                  is on whenever the effective uid (gid) is not equal to the
  1763.                  real uid (gid).  Turning this off causes the effective uid
  1764.                  and gid to be set to the real uid and gid.
  1765.  
  1766.          --ss      Sort the positional parameters lexicographically.
  1767.  
  1768.          --tt      Exit after reading and executing one command.
  1769.  
  1770.          --uu      Treat unset parameters as an error when substituting.
  1771.  
  1772.          --vv      Print shell input lines as they are read.
  1773.  
  1774.          --xx      Print commands and their arguments as they are executed.
  1775.  
  1776.          --       Turns off --xx and --vv flags and stops examining arguments for
  1777.                  flags.
  1778.  
  1779.          ----      Do not change any of the flags; useful in setting $$11 to a
  1780.                  value beginning with ``-''.  If no arguments follow this
  1781.                  flag then the positional parameters are unset.
  1782.  
  1783.          Using ``+'' rather than ``-'' causes these flags to be turned off.
  1784.          These flags can also be used upon invocation of the shell.  The
  1785.          current set of flags may be found in $$--.  Unless --AA is specified,
  1786.          the remaining arguments are positional parameters and are assigned,
  1787.          in order, to $$11 $$22 ....  If no arguments are given then the names
  1788.          and values of all named parameters are printed on the standard out-
  1789.          put.  If the only argument is ``+'', the names of all named parame-
  1790.          ters are printed.
  1791.  
  1792.     {1} sshhiifftt [ _nn ]
  1793.          The positional parameters from $$_nn++11 ...  are renamed 11 ......, default
  1794.          _nn is 1.  The parameter _nn can be any arithmetic expression that
  1795.          evaluates to a non-negative number less than or equal to $$##.
  1796.  
  1797.     {1} ttiimmeess
  1798.          Print the accumulated user and system times for the shell and for
  1799.          processes run from the shell.
  1800.  
  1801.     {1} ttrraapp [ _aa_rr_gg ] [ _ss_ii_gg ] ...
  1802.          _aa_rr_gg is a command to be read and executed when the shell receives
  1803.          signal(s) _ss_ii_gg.  (Note that _aa_rr_gg is scanned once when the trap is set
  1804.          and once when the trap is taken.)  Each _ss_ii_gg can be given as a number
  1805.          or as the name of the signal.  Trap commands are executed in order
  1806.          of signal number.  Any attempt to set a trap on a signal that was
  1807.          ignored on entry to the current shell is ineffective.  If _aa_rr_gg is
  1808.          omitted or is ``-'', then all trap(s) _ss_ii_gg are reset to their origi-
  1809.          nal values.  If _aa_rr_gg is the null string then this signal is ignored
  1810.          by the shell and by the commands it invokes.  If _ss_ii_gg is EERRRR then _aa_rr_gg
  1811.          will be executed whenever a command has a non-zero exit status.  If
  1812.          _ss_ii_gg is DDEEBBUUGG then _aa_rr_gg will be executed after each command.  If _ss_ii_gg
  1813.          is 00 or EEXXIITT and the ttrraapp statement is executed inside the body of a
  1814.          function, then the command _aa_rr_gg is executed after the function com-
  1815.          pletes.  If _ss_ii_gg is 00 or EEXXIITT for a ttrraapp set outside any function
  1816.          then the command _aa_rr_gg is executed on exit from the shell.  The ttrraapp
  1817.          command with no arguments prints a list of commands associated with
  1818.          each signal number.
  1819.  
  1820.     {2} ttyyppeesseett [ +-HLRZfilrtux [n] ] [ name[ =value ] ] ...
  1821.          Sets attributes and values for shell parameters.  When invoked
  1822.          inside a function, a new instance of the parameter _nn_aa_mm_ee is created.
  1823.          The parameter value and type are restored when the function com-
  1824.          pletes.  The following list of attributes may be specified:
  1825.  
  1826.          --HH  This flag provides UNIX system to host-name file mapping on
  1827.              non-UNIX system machines.
  1828.  
  1829.          --LL  Left justify and remove leading blanks from _vv_aa_ll_uu_ee.  If _nn is
  1830.              non-zero it defines the width of the field; otherwise it is
  1831.              determined by the width of the value of first assignment.  When
  1832.              the parameter is assigned to, it is filled on the right with
  1833.              blanks or truncated, if necessary, to fit into the field.  Lead-
  1834.              ing zeros are removed if the --ZZ flag is also set.  The --RR flag
  1835.              is turned off.
  1836.  
  1837.          --RR  Right justify and fill with leading blanks.  If _nn is non-zero it
  1838.              defines the width of the field; otherwise it is determined by
  1839.              the width of the value of first assignment.  The field is left
  1840.              filled with blanks or truncated from the end if the parameter is
  1841.              reassigned.  The --LL flag is turned off.
  1842.  
  1843.          --ZZ  Right justify and fill with leading zeros if the first non-blank
  1844.              character is a digit and the --LL flag has not been set.  If _nn is
  1845.              non-zero it defines the width of the field; otherwise it is
  1846.              determined by the width of the value of first assignment.
  1847.  
  1848.          --ff  The names refer to function names rather than parameter names.
  1849.              No assignments can be made and the only other valid flags are
  1850.              --tt, --uu and --xx.  The flag --tt turns on execution tracing for this
  1851.              function.  The flag --uu causes this function to be marked as
  1852.              undefined.  The FFPPAATTHH variable will be searched to find the
  1853.              function definition when the function is referenced.  The flag
  1854.              --xx allows the function definition to remain in effect across
  1855.              shell procedures invoked by name.
  1856.  
  1857.          --ii  Parameter is an integer.  This makes arithmetic faster.  If _nn is
  1858.              non-zero it defines the output arithmetic base; otherwise the
  1859.              first assignment determines the output base.
  1860.  
  1861.          --ll  All upper-case characters converted to lower-case.  The upper-
  1862.              case flag, --uu is turned off.
  1863.  
  1864.          --rr  The given _nn_aa_mm_ees are marked read only and these names cannot be
  1865.              changed by subsequent assignment.
  1866.  
  1867.          --tt  Tags the named parameters.  Tags are user definable and have no
  1868.              special meaning to the shell.
  1869.  
  1870.          --uu  All lower-case characters are converted to upper-case charac-
  1871.              ters.  The lower-case flag, --ll, is turned off.
  1872.  
  1873.          --xx  The given _nn_aa_mm_ees are marked for automatic export to the environ-
  1874.              ment of subsequently-executed commands.
  1875.  
  1876.          Using ``+'' rather than ``-'' causes these flags to be turned off.
  1877.          If no _nn_aa_mm_ee arguments are given but flags are specified, a list of
  1878.          names (and optionally the values) of the parameters which have these
  1879.          flags set is printed.  (Using ``+'' rather than ``-'' keeps the
  1880.          values from being printed.)  If no _nn_aa_mm_ees and flags are given, the
  1881.          names and attributes of all parameters are printed.
  1882.  
  1883.     uulliimmiitt [ --HHSS ] [ _ll_ii_mm_ii_tt ]
  1884.          Set or display a resource limit.  The number of 512-byte blocks on
  1885.          files written by child processes (files of any size may be read).
  1886.          The limit is set when _ll_ii_mm_ii_tt is specified.  The value of _ll_ii_mm_ii_tt can be
  1887.          a number or the value uunnlliimmiitteedd.  The --HH and --SS flags specify
  1888.          whether the hard limit or the soft limit is set.  A hard limit can-
  1889.          not be increased once it is set. A soft limit can be increased up to
  1890.          the value of the hard limit.  If neither the --HH or --SS option is
  1891.          specified, the limit applies to both.  The current limit is printed
  1892.          when _ll_ii_mm_ii_tt is omitted.  In this case the soft limit is printed
  1893.          unless --HH is specified.
  1894.  
  1895.     uummaasskk [ _mm_aa_ss_kk ]
  1896.          The user file-creation mask is set to _mm_aa_ss_kk (see uummaasskk).  _mm_aa_ss_kk can
  1897.          either be an octal number or a symbolic value as described in
  1898.          cchhmmoodd(C).  If a symbolic value is given, the new umask value is the
  1899.          complement of the result of applying _mm_aa_ss_kk to the complement of the
  1900.          previous umask value.  If _mm_aa_ss_kk is omitted, the current value of the
  1901.          mask is printed.
  1902.  
  1903.     uunnaalliiaass _nn_aa_mm_ee ...
  1904.          The parameters given by the list of _nn_aa_mm_ees are removed from the alias
  1905.          list.
  1906.  
  1907.     uunnsseett [ --ff ] _nn_aa_mm_ee ...
  1908.          The parameters given by the list of names are unassigned, that is,
  1909.          their values and attributes are erased.  Readonly variables cannot
  1910.          be unset.  If the flag, --ff, is set, then the names refer to function
  1911.          names.  Unsetting EERRRRNNOO, LLIINNEENNOO, MMAAIILLCCHHEECCKK, OOPPTTAARRGG, OOPPTTIINNDD, RRAANNDDOOMM,
  1912.          SSEECCOONNDDSS, TTMMOOUUTT, and ``_'' removes their special meaning even if they
  1913.          are subsequently assigned to.
  1914.  
  1915.     {1} wwaaiitt [ _jj_oo_bb ]
  1916.          Wait for the specified job and report its termination status.  If
  1917.          _jj_oo_bb is not given then all currently active child processes are
  1918.          waited for.  The exit status from this command is that of the pro-
  1919.          cess waited for.  See ``Jobs'' for a description of the format of
  1920.          _jj_oo_bb.
  1921.  
  1922.     wwhheennccee [ --ppvv ] _nn_aa_mm_ee ...
  1923.          For each _nn_aa_mm_ee, indicate how it would be interpreted if used as a
  1924.          command name.
  1925.  
  1926.          The flag, --vv, produces a more verbose report.
  1927.  
  1928.          The flag, --pp, does a path search for _nn_aa_mm_ee even if name is an alias,
  1929.          a function, or a reserved word.
  1930.  
  1931.     _I_n_v_o_c_a_t_i_o_n
  1932.  
  1933.     If the shell is invoked by eexxeecc(S), and the first character of argument
  1934.     zero ($$00) is ``-'', then the shell is assumed to be a login shell and
  1935.     commands are read from /_e_t_c/_p_r_o_f_i_l_e and then from either ._p_r_o_f_i_l_e in the
  1936.     current directory or $$HHOOMMEE/._p_r_o_f_i_l_e, if either file exists.  Next, com-
  1937.     mands are read from the file named by performing parameter substitution
  1938.     on the value of the environment parameter EENNVV if the file exists.  If the
  1939.     --ss flag is not present and _aa_rr_gg is, then a path search is performed on the
  1940.     first _aa_rr_gg to determine the name of the script to execute.  The script _aa_rr_gg
  1941.     must have read permission and any sseettuuiidd and sseettggiidd settings will be
  1942.     ignored.  Commands are then read as described below; the following flags
  1943.     are interpreted by the shell when it is invoked:
  1944.  
  1945.     --cc _ss_tt_rr_ii_nn_gg If the --cc flag is present then commands are read from _ss_tt_rr_ii_nn_gg.
  1946.  
  1947.     --ss        If the --ss flag is present or if no arguments remain then com-
  1948.               mands are read from the standard input.  Shell output, except
  1949.               for the output of the special commands listed above, is written
  1950.               to file descriptor 2.
  1951.  
  1952.     --ii        If the --ii flag is present or if the shell input and output are
  1953.               attached to a terminal (as told by iiooccttll(S)) then this shell is
  1954.               interactive.  In this case TTEERRMM is ignored (so that kkiillll 00 does
  1955.               not kill an interactive shell) and IINNTTRR is caught and ignored
  1956.               (so that wwaaiitt is interruptible).  In all cases, QQUUIITT is ignored
  1957.               by the shell.
  1958.  
  1959.     --rr        If the --rr flag is present the shell is a restricted shell.
  1960.  
  1961.     The remaining flags and arguments are described under the sseett command
  1962.     above.
  1963.  
  1964.     _r_k_s_h _o_n_l_y
  1965.  
  1966.     rrkksshh is used to set up login names and execution environments whose capa-
  1967.     bilities are more controlled than those of the standard shell.  The
  1968.     actions of rrkksshh are identical to those of kksshh, except that the following
  1969.     are disallowed:
  1970.  
  1971.          changing directory (see ccdd(C)),
  1972.          setting the value of SSHHEELLLL, EENNVV, or PPAATTHH,
  1973.          specifying path or command names containing ``/'',
  1974.          redirecting output (>>, >>||, <<>>, and >>>>).
  1975.  
  1976.     The restrictions above are enforced after ._p_r_o_f_i_l_e and the EENNVV files are
  1977.     interpreted.
  1978.     When a command to be executed is found to be a shell procedure, rrkksshh
  1979.     invokes kksshh to execute it.  Thus, it is possible to provide shell pro-
  1980.     cedures to the end-user that have access to the full power of the stan-
  1981.     dard shell, while imposing a limited menu of commands; this scheme
  1982.     assumes that the end-user does not have write and execute permissions in
  1983.     the same directory.
  1984.  
  1985.     The net effect of these rules is that the writer of the ._p_r_o_f_i_l_e has com-
  1986.     plete control over user actions, by performing guaranteed setup actions
  1987.     and leaving the user in an appropriate directory (probably _n_o_t the login
  1988.     directory).
  1989.  
  1990.     The system administrator often sets up a directory of commands (for exam-
  1991.     ple, /_u_s_r/_r_b_i_n) that can be safely invoked by rrkksshh.  There is also a re-
  1992.     stricted editor, rreedd.
  1993.  
  1994.     Note that simply setting a user's login shell to rrkksshh does _n_o_t make their
  1995.     account ``safe''.  Some thought and care must be put into creating a
  1996.     properly restricted environment.
  1997.  
  1998.  _D_i_a_g_n_o_s_t_i_c_s
  1999.  
  2000.     Errors detected by the shell, such as syntax errors, cause the shell to
  2001.     return a non-zero exit status.  Otherwise, the shell returns the exit
  2002.     status of the last command executed (see also the eexxiitt command above).
  2003.     If the shell is being used non-interactively then execution of the shell
  2004.     file is abandoned.  Run-time errors detected by the shell are reported by
  2005.     printing the command or function name and the error condition.  If the
  2006.     line number that the error occurred on is greater than one, then the line
  2007.     number is also printed in square brackets ([ ]) after the command or
  2008.     function name.
  2009.  
  2010.  _F_i_l_e_s
  2011.  
  2012.     /_e_t_c/_p_a_s_s_w_d
  2013.     /_e_t_c/_p_r_o_f_i_l_e
  2014.     /_e_t_c/_s_u_i_d__p_r_o_f_i_l_e
  2015.     $$HHOOMMEE/._p_r_o_f_i_l_e
  2016.     /_t_m_p/_s_h*
  2017.     /_d_e_v/_n_u_l_l
  2018.  
  2019.  _S_e_e _a_l_s_o
  2020.  
  2021.     ccaatt(C), ccdd(C), cchhmmoodd(C), ccuutt(C), eecchhoo(C), eennvv(C), llnn(C), nneewwggrrpp(C),
  2022.     ppaassttee(C), ssttttyy(C), tteesstt(C), uummaasskk(C), vvii(C), dduupp(S), eexxeecc(S), ffoorrkk(S),
  2023.     iiooccttll(S), llsseeeekk(S), ppiippee(S), ssiiggnnaall(S), uummaasskk(S), uulliimmiitt(S), wwaaiitt(S),
  2024.     rraanndd(S), aa..oouutt(FP), pprrooffiillee(M) and eennvviirroonn(M).
  2025.  
  2026.     The chapter entitled ``The Korn Shell'' in the SCO UNIX _U_s_e_r'_s _G_u_i_d_e.
  2027.  
  2028.  _N_o_t_e_s
  2029.  
  2030.     If a command which is a tracked alias is executed, and then a command
  2031.     with the same name is installed in a directory in the search path before
  2032.     the directory where the original command was found, the shell will con-
  2033.     tinue to eexxeecc the original command.  Use the --tt option of the aalliiaass com-
  2034.     mand to correct this situation.
  2035.  
  2036.     Some very old shell scripts contain a ``^'' as a synonym for the pipe
  2037.     character (||).
  2038.  
  2039.     Using the ffcc built-in command within a compound command will cause the
  2040.     whole command to disappear from the history file.
  2041.  
  2042.     The built-in command .. _ff_ii_ll_ee reads the whole file before any commands are
  2043.     executed.  Therefore, aalliiaass and uunnaalliiaass commands in the file will not
  2044.     apply to any functions defined in the file.
  2045.  
  2046.     Traps are not processed while a job is waiting for a foreground process.
  2047.     Thus, a trap on CCHHLLDD won't be executed until the foreground job ter-
  2048.     minates.
  2049.  
  2050.